feat: complete quickshell redesign
This commit is contained in:
1 parent
1eb0820083
commit
0ff727898a
25 files changed
+1410
-401
No files matched your search
@@ -0,0 +1,44 @@
|
||||
import QtQuick
|
||||
import "."
|
||||
|
||||
// Rectangular tray + square thumb toggle, per DESIGN.md: 36x20 tray, 12x12
|
||||
// thumb that translates (never curves) between two hard-stop positions.
|
||||
Item {
|
||||
id: toggle
|
||||
|
||||
// Controlled component: clicking never mutates `checked` itself, it
|
||||
// only requests a change via `toggled()` - the caller owns the real
|
||||
// state (usually a live system property) and rebinds `checked` to it.
|
||||
property bool checked: false
|
||||
property color onColor: Theme.colors.success
|
||||
signal toggled()
|
||||
|
||||
implicitWidth: 36
|
||||
implicitHeight: 20
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: toggle.checked ? toggle.onColor : Theme.colors.surface
|
||||
border.width: Theme.geometry.borderWidth
|
||||
border.color: Theme.colors.crust
|
||||
|
||||
Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } }
|
||||
|
||||
Rectangle {
|
||||
id: thumb
|
||||
width: 12
|
||||
height: 12
|
||||
y: (parent.height - height) / 2
|
||||
x: toggle.checked ? parent.width - width - 4 : 4
|
||||
color: Theme.colors.crust
|
||||
|
||||
Behavior on x { NumberAnimation { duration: Theme.animation.durationFast; easing.type: Easing.Linear } }
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: toggle.toggled()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user