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 {
id: volDropdownCol
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
// Master volume
Text {
text: "\u{f057e} Master"
color: Theme.base05
@ -1381,19 +1395,31 @@ in
width: parent.width
spacing: 8
Rectangle {
// Slim pill slider: 6px fully-rounded track,
// 20px invisible hit area for comfy dragging
Item {
id: masterSliderBg
width: parent.width - masterVolLabel.width - 8
height: 20
radius: 4
color: Theme.base01
anchors.verticalCenter: parent.verticalCenter
Rectangle {
width: volWidget.sink && volWidget.sink.audio
? Math.min(1, volWidget.sink.audio.volume) * parent.width : 0
height: parent.height
radius: 4
anchors.verticalCenter: parent.verticalCenter
width: parent.width
height: 6
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
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
Text {
// Applications card
Rectangle {
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"
color: Theme.base05
font.family: Theme.fontFamily
@ -1501,18 +1534,28 @@ in
width: parent.width
spacing: 8
Rectangle {
// Slim pill slider, 16px hit area
Item {
width: parent.width - appVolLabel.width - 8
height: 16
radius: 3
color: Theme.base01
anchors.verticalCenter: parent.verticalCenter
Rectangle {
width: modelData.audio
? Math.min(1, modelData.audio.volume) * parent.width : 0
height: parent.height
radius: 3
anchors.verticalCenter: parent.verticalCenter
width: parent.width
height: 4
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
? Theme.base03 : Theme.base0C
Behavior on width { NumberAnimation { duration: 80 } }
@ -1546,6 +1589,8 @@ in
}
}
}
}
}
// Network dropdown
BarDropdown {
@ -1701,9 +1746,23 @@ in
Column {
id: batteryDropdownCol
anchors.centerIn: parent
width: 200
width: 208
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 {
width: parent.width
spacing: 8
@ -1727,24 +1786,34 @@ in
}
Text {
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
font.family: Theme.fontFamily
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: "Power Profile"
color: Theme.base03
color: Theme.base04
font.family: Theme.fontFamily
font.pixelSize: 11
}
@ -1790,7 +1859,7 @@ in
height: 36
radius: 6
color: profMouse.containsMouse && batteryWidget.powerProfile !== modelData.name
? Theme.base01 : "transparent"
? Theme.base02 : "transparent"
Behavior on color { ColorAnimation { duration: 120 } }
Column {
@ -1829,6 +1898,8 @@ in
}
}
}
}
}
''}
// Calendar popup GNOME-style two-pane panel.