aboutsummaryrefslogtreecommitdiff
path: root/modules/system/quickshell/Toggle.qml
diff options
context:
space:
mode:
authorLeander Scherer <leander@schererleander.de>2026-05-30 15:35:27 +0200
committerLeander Scherer <leander@schererleander.de>2026-05-30 15:35:27 +0200
commitd2747e2ca1e211a32e91e44010f40a00e0ac97e4 (patch)
treefb229d6a18541c7a5f1944390b21edde028955f9 /modules/system/quickshell/Toggle.qml
parent51b3cbd50b92d026549ce3ebff17ca9b3344f441 (diff)
feat(quickshell): add popup controls and privacy indicators
Diffstat (limited to 'modules/system/quickshell/Toggle.qml')
-rw-r--r--modules/system/quickshell/Toggle.qml19
1 files changed, 12 insertions, 7 deletions
diff --git a/modules/system/quickshell/Toggle.qml b/modules/system/quickshell/Toggle.qml
index 76eb36c..d9e83e2 100644
--- a/modules/system/quickshell/Toggle.qml
+++ b/modules/system/quickshell/Toggle.qml
@@ -1,12 +1,9 @@
import QtQuick
-// iOS-style on/off switch. `checked` is the visual state; the parent
-// owns truth and handles `toggled` by flipping it. Uses Item.enabled
-// for the disabled visual + input gating.
Rectangle {
id: root
property bool checked: false
- signal toggled()
+ signal toggled
width: 40
height: 22
@@ -19,13 +16,21 @@ Rectangle {
height: 18
radius: 9
color: Theme.text
- anchors { verticalCenter: parent.verticalCenter }
+ anchors {
+ verticalCenter: parent.verticalCenter
+ }
x: root.checked ? parent.width - width - 2 : 2
- Behavior on x { NumberAnimation { duration: 150 } }
+ Behavior on x {
+ NumberAnimation {
+ duration: 150
+ }
+ }
}
MouseArea {
- anchors { fill: parent }
+ anchors {
+ fill: parent
+ }
onClicked: root.toggled()
}
}