quickshell: align battery row to baseline; session icons computed-bright, filled when selected

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-06-12 19:21:53 +01:00
parent cae1a69026
commit 1b22c771f4

View file

@ -635,14 +635,19 @@ in
Text {
anchors.centerIn: parent
text: sessBtn.modelData.icon
// Qt.lighter: the generated palette's base07 is
// nearly identical to base05, so brightness must
// be computed, not picked from a slot
color: sessBtn.modelData.danger && sessionMenu.selIdx === sessBtn.index
? Theme.base08 : Theme.base07
? Theme.base08 : Qt.lighter(Theme.base07, 1.2)
Behavior on color { ColorAnimation { duration: 120 } }
font.family: Theme.iconFont
font.pixelSize: 20
// Thicken the variable font's strokes outlined
// Material Symbols read dim at default weight
// Material Symbols read dim at default weight
// and render the selected icon filled
font.weight: 600
font.variableAxes: { "FILL": sessionMenu.selIdx === sessBtn.index ? 1.0 : 0.0 }
}
MouseArea {
@ -1095,8 +1100,12 @@ in
anchors.verticalCenter: parent.verticalCenter
spacing: 4
// Explicit vertical centering: Rows top-align by
// default, and the icon font's taller line metrics
// would push the text off the shared baseline.
Text {
id: batteryText
anchors.verticalCenter: parent.verticalCenter
text: batteryWidget.batteryLevel + "%"
color: batteryWidget.batteryLevel <= 15 ? Theme.base08
: batteryWidget.batteryLevel <= 30 ? Theme.base0A
@ -1107,6 +1116,7 @@ in
Text {
id: batteryIconText
anchors.verticalCenter: parent.verticalCenter
text: batteryWidget.batteryIcon
color: batteryWidget.batteryLevel <= 15 ? Theme.base08
: batteryWidget.batteryLevel <= 30 ? Theme.base0A