quickshell: slim pill sliders; card-style volume and battery dropdowns

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-06-12 10:41:13 +01:00
parent 9a38cacc05
commit 4540e38321

View file

@ -1365,10 +1365,24 @@ in
Column { Column {
id: volDropdownCol id: volDropdownCol
anchors.centerIn: parent anchors.centerIn: parent
width: 260 width: 268
spacing: 8
// Master volume card
Rectangle {
width: parent.width
height: masterCardCol.height + 16
radius: 8
color: Theme.base01
Column {
id: masterCardCol
anchors.top: parent.top
anchors.topMargin: 8
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width - 16
spacing: 8 spacing: 8
// Master volume
Text { Text {
text: "\u{f057e} Master" text: "\u{f057e} Master"
color: Theme.base05 color: Theme.base05
@ -1381,19 +1395,31 @@ in
width: parent.width width: parent.width
spacing: 8 spacing: 8
Rectangle { // Slim pill slider: 6px fully-rounded track,
// 20px invisible hit area for comfy dragging
Item {
id: masterSliderBg id: masterSliderBg
width: parent.width - masterVolLabel.width - 8 width: parent.width - masterVolLabel.width - 8
height: 20 height: 20
radius: 4
color: Theme.base01
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
Rectangle { Rectangle {
width: volWidget.sink && volWidget.sink.audio anchors.verticalCenter: parent.verticalCenter
? Math.min(1, volWidget.sink.audio.volume) * parent.width : 0 width: parent.width
height: parent.height height: 6
radius: 4 radius: 3
color: Theme.base02
}
Rectangle {
anchors.verticalCenter: parent.verticalCenter
width: {
let v = volWidget.sink && volWidget.sink.audio
? Math.min(1, volWidget.sink.audio.volume) : 0;
return v > 0 ? Math.max(6, v * parent.width) : 0;
}
height: 6
radius: 3
color: volWidget.muted ? Theme.base03 : Theme.base0D color: volWidget.muted ? Theme.base03 : Theme.base0D
Behavior on width { NumberAnimation { duration: 80 } } Behavior on width { NumberAnimation { duration: 80 } }
} }
@ -1448,19 +1474,26 @@ in
} }
} }
} }
}
// Separator
Rectangle {
width: parent.width - 20
anchors.horizontalCenter: parent.horizontalCenter
height: 1
color: Theme.base02
visible: appStreamsCol.childrenRect.height > 0
} }
// App streams header // Applications card
Text { Rectangle {
visible: appStreamsCol.childrenRect.height > 0 visible: appStreamsCol.childrenRect.height > 0
width: parent.width
height: appsCardCol.height + 16
radius: 8
color: Theme.base01
Column {
id: appsCardCol
anchors.top: parent.top
anchors.topMargin: 8
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width - 16
spacing: 8
Text {
text: "\u{f0641} Applications" text: "\u{f0641} Applications"
color: Theme.base05 color: Theme.base05
font.family: Theme.fontFamily font.family: Theme.fontFamily
@ -1501,18 +1534,28 @@ in
width: parent.width width: parent.width
spacing: 8 spacing: 8
Rectangle { // Slim pill slider, 16px hit area
Item {
width: parent.width - appVolLabel.width - 8 width: parent.width - appVolLabel.width - 8
height: 16 height: 16
radius: 3
color: Theme.base01
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
Rectangle { Rectangle {
width: modelData.audio anchors.verticalCenter: parent.verticalCenter
? Math.min(1, modelData.audio.volume) * parent.width : 0 width: parent.width
height: parent.height height: 4
radius: 3 radius: 2
color: Theme.base02
}
Rectangle {
anchors.verticalCenter: parent.verticalCenter
width: {
let v = modelData.audio ? Math.min(1, modelData.audio.volume) : 0;
return v > 0 ? Math.max(4, v * parent.width) : 0;
}
height: 4
radius: 2
color: modelData.audio && modelData.audio.muted color: modelData.audio && modelData.audio.muted
? Theme.base03 : Theme.base0C ? Theme.base03 : Theme.base0C
Behavior on width { NumberAnimation { duration: 80 } } Behavior on width { NumberAnimation { duration: 80 } }
@ -1546,6 +1589,8 @@ in
} }
} }
} }
}
}
// Network dropdown // Network dropdown
BarDropdown { BarDropdown {
@ -1701,9 +1746,23 @@ in
Column { Column {
id: batteryDropdownCol id: batteryDropdownCol
anchors.centerIn: parent anchors.centerIn: parent
width: 200 width: 208
spacing: 8 spacing: 8
// Battery status card
Rectangle {
width: parent.width
height: battCardCol.height + 16
radius: 8
color: Theme.base01
Column {
id: battCardCol
anchors.top: parent.top
anchors.topMargin: 8
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width - 16
Row { Row {
width: parent.width width: parent.width
spacing: 8 spacing: 8
@ -1727,24 +1786,34 @@ in
} }
Text { Text {
text: batteryWidget.powerDraw.toFixed(1) + " W" text: batteryWidget.powerDraw.toFixed(1) + " W"
+ (batteryWidget.timeRemaining !== "" ? " \u2022 " + batteryWidget.timeRemaining + (batteryWidget.charging ? " to full" : " left") : "") + (batteryWidget.timeRemaining !== "" ? " " + batteryWidget.timeRemaining + (batteryWidget.charging ? " to full" : " left") : "")
color: Theme.base04 color: Theme.base04
font.family: Theme.fontFamily font.family: Theme.fontFamily
font.pixelSize: 11 font.pixelSize: 11
} }
} }
} }
Rectangle {
width: parent.width - 10
anchors.horizontalCenter: parent.horizontalCenter
height: 1
color: Theme.base03
} }
}
// Power profile card
Rectangle {
width: parent.width
height: profCardCol.height + 16
radius: 8
color: Theme.base01
Column {
id: profCardCol
anchors.top: parent.top
anchors.topMargin: 8
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width - 16
spacing: 6
Text { Text {
text: "Power Profile" text: "Power Profile"
color: Theme.base03 color: Theme.base04
font.family: Theme.fontFamily font.family: Theme.fontFamily
font.pixelSize: 11 font.pixelSize: 11
} }
@ -1790,7 +1859,7 @@ in
height: 36 height: 36
radius: 6 radius: 6
color: profMouse.containsMouse && batteryWidget.powerProfile !== modelData.name color: profMouse.containsMouse && batteryWidget.powerProfile !== modelData.name
? Theme.base01 : "transparent" ? Theme.base02 : "transparent"
Behavior on color { ColorAnimation { duration: 120 } } Behavior on color { ColorAnimation { duration: 120 } }
Column { Column {
@ -1829,6 +1898,8 @@ in
} }
} }
} }
}
}
''} ''}
// Calendar popup GNOME-style two-pane panel. // Calendar popup GNOME-style two-pane panel.