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:
parent
1b22c771f4
commit
a4a34e7248
1 changed files with 12 additions and 10 deletions
|
|
@ -626,28 +626,30 @@ in
|
||||||
id: sessBtn
|
id: sessBtn
|
||||||
required property var modelData
|
required property var modelData
|
||||||
required property int index
|
required property int index
|
||||||
|
readonly property bool selected: sessionMenu.selIdx === index
|
||||||
width: 40
|
width: 40
|
||||||
height: 40
|
height: 40
|
||||||
radius: 8
|
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 } }
|
Behavior on color { ColorAnimation { duration: 120 } }
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: sessBtn.modelData.icon
|
text: sessBtn.modelData.icon
|
||||||
// Qt.lighter: the generated palette's base07 is
|
// Accent for the active icon (like the workspace
|
||||||
// nearly identical to base05, so brightness must
|
// pill), base05 idle, base08 for armed danger
|
||||||
// be computed, not picked from a slot
|
color: sessBtn.selected
|
||||||
color: sessBtn.modelData.danger && sessionMenu.selIdx === sessBtn.index
|
? (sessBtn.modelData.danger ? Theme.base08 : Theme.base0D)
|
||||||
? Theme.base08 : Qt.lighter(Theme.base07, 1.2)
|
: Theme.base05
|
||||||
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
|
|
||||||
// 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 }
|
font.variableAxes: { "FILL": sessBtn.selected ? 1.0 : 0.0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue