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:
parent
cae1a69026
commit
1b22c771f4
1 changed files with 12 additions and 2 deletions
|
|
@ -635,14 +635,19 @@ in
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: sessBtn.modelData.icon
|
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
|
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 } }
|
Behavior on color { ColorAnimation { duration: 120 } }
|
||||||
font.family: Theme.iconFont
|
font.family: Theme.iconFont
|
||||||
font.pixelSize: 20
|
font.pixelSize: 20
|
||||||
// Thicken the variable font's strokes — outlined
|
// 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.weight: 600
|
||||||
|
font.variableAxes: { "FILL": sessionMenu.selIdx === sessBtn.index ? 1.0 : 0.0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
@ -1095,8 +1100,12 @@ in
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
spacing: 4
|
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 {
|
Text {
|
||||||
id: batteryText
|
id: batteryText
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: batteryWidget.batteryLevel + "%"
|
text: batteryWidget.batteryLevel + "%"
|
||||||
color: batteryWidget.batteryLevel <= 15 ? Theme.base08
|
color: batteryWidget.batteryLevel <= 15 ? Theme.base08
|
||||||
: batteryWidget.batteryLevel <= 30 ? Theme.base0A
|
: batteryWidget.batteryLevel <= 30 ? Theme.base0A
|
||||||
|
|
@ -1107,6 +1116,7 @@ in
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: batteryIconText
|
id: batteryIconText
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: batteryWidget.batteryIcon
|
text: batteryWidget.batteryIcon
|
||||||
color: batteryWidget.batteryLevel <= 15 ? Theme.base08
|
color: batteryWidget.batteryLevel <= 15 ? Theme.base08
|
||||||
: batteryWidget.batteryLevel <= 30 ? Theme.base0A
|
: batteryWidget.batteryLevel <= 30 ? Theme.base0A
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue