quickshell: session menu follows the shell's selection grammar (pill border, accent icon)

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

View file

@ -626,28 +626,30 @@ in
id: sessBtn
required property var modelData
required property int index
readonly property bool selected: sessionMenu.selIdx === index
width: 40
height: 40
radius: 8
color: sessionMenu.selIdx === index ? Theme.base02 : "transparent"
// Same selection grammar as the power-profile pill
// and calendar "today": base02 surface, base03 border
color: selected ? Theme.base02 : "transparent"
border.width: selected ? 1 : 0
border.color: Theme.base03
Behavior on color { ColorAnimation { duration: 120 } }
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 : Qt.lighter(Theme.base07, 1.2)
// Accent for the active icon (like the workspace
// pill), base05 idle, base08 for armed danger
color: sessBtn.selected
? (sessBtn.modelData.danger ? Theme.base08 : Theme.base0D)
: Theme.base05
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
// and render the selected icon filled
font.weight: 600
font.variableAxes: { "FILL": sessionMenu.selIdx === sessBtn.index ? 1.0 : 0.0 }
font.variableAxes: { "FILL": sessBtn.selected ? 1.0 : 0.0 }
}
MouseArea {