use styled switch

This commit is contained in:
Benjamin Palko 2025-08-31 11:33:19 -04:00
parent 135446ab82
commit e27dadba0f
2 changed files with 12 additions and 27 deletions

View file

@ -4,7 +4,6 @@ import qs.components
import qs.config import qs.config
import qs.widgets import qs.widgets
import QtQuick import QtQuick
import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Bluetooth import Quickshell.Bluetooth
@ -22,32 +21,22 @@ StyledPopupWindow {
margin: 16 margin: 16
Layout.fillWidth: true Layout.fillWidth: true
RowLayout { RowLayout {
RowLayout { StyledSwitch {
StyledText {
text: "Enabled" text: "Enabled"
}
Switch {
checkable: !!Bluetooth.defaultAdapter checkable: !!Bluetooth.defaultAdapter
checked: Bluetooth.defaultAdapter?.enabled ?? false checked: Bluetooth.defaultAdapter?.enabled ?? false
onClicked: Bluetooth.defaultAdapter.enabled = checked onClicked: Bluetooth.defaultAdapter.enabled = checked
} }
}
RowLayout { StyledSwitch {
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
StyledText {
text: "Scan" text: "Scan"
}
Switch {
checkable: !!Bluetooth.defaultAdapter checkable: !!Bluetooth.defaultAdapter
checked: Bluetooth.defaultAdapter?.discovering ?? false checked: Bluetooth.defaultAdapter?.discovering ?? false
onClicked: Bluetooth.defaultAdapter.discovering = checked onClicked: Bluetooth.defaultAdapter.discovering = checked
} }
} }
} }
}
StyledWrapperRectangle { StyledWrapperRectangle {
margin: 16 margin: 16

View file

@ -5,7 +5,6 @@ import qs.config
import qs.services import qs.services
import qs.widgets import qs.widgets
import QtQuick import QtQuick
import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
StyledPopupWindow { StyledPopupWindow {
@ -20,17 +19,14 @@ StyledPopupWindow {
RowLayout { RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
StyledText {
text: "Enabled"
}
Switch { StyledSwitch {
text: "Enabled"
checked: Notifications.enabled checked: Notifications.enabled
onClicked: Notifications.enabled = checked onClicked: Notifications.enabled = checked
} }
StyledButton { StyledButton {
id: clearButton
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
text: "Clear" text: "Clear"
onClicked: Notifications.clear() onClicked: Notifications.clear()