quickshell: segment bar groups, pin server glance

This commit is contained in:
rope 2026-07-28 22:10:47 +01:00
parent 4df4062806
commit 7bfd1e25c3

View file

@ -775,6 +775,20 @@ in
font.pixelSize: 16 font.pixelSize: 16
} }
// BarSep: hairline between widget groups in the bar column.
// Wrapped in a plain Item because a Column refuses to position
// children that set their own horizontalCenter anchor.
component BarSep: Item {
width: Theme.barWidth
height: 1
Rectangle {
anchors.centerIn: parent
width: 16
height: 1
color: Theme.base02
}
}
// GlanceStat: a bar-column stat clock-sized value over a // GlanceStat: a bar-column stat clock-sized value over a
// faded 9px caption (the server glance rows). // faded 9px caption (the server glance rows).
component GlanceStat: Column { component GlanceStat: Column {
@ -1621,9 +1635,11 @@ in
precision: SystemClock.Minutes precision: SystemClock.Minutes
} }
// Top cluster: logo, clock, workspaces. The bar is a column // Top cluster: logo, clock, workspaces the three groups
// now, so the two clusters anchor to opposite ends and the gap // that belong to "this machine, right now", split by hairlines.
// between them is the OSD slot. // The server glance is NOT here: it anchors above the bottom
// cluster instead, so adding a workspace grows this column
// downward into empty space rather than shoving the stats.
Column { Column {
id: barTop id: barTop
anchors.top: parent.top anchors.top: parent.top
@ -1663,6 +1679,8 @@ in
} }
} }
BarSep {}
// Clock HH over mm; "HH:mm" does not fit a 46px column. // Clock HH over mm; "HH:mm" does not fit a 46px column.
Item { Item {
id: clockText id: clockText
@ -1713,6 +1731,8 @@ in
} }
} }
BarSep {}
// Workspace dots: accent pill for the focused workspace, // Workspace dots: accent pill for the focused workspace,
// dim dots otherwise. Stacked vertically now, so the // dim dots otherwise. Stacked vertically now, so the
// focused pill grows along HEIGHT rather than width. // focused pill grows along HEIGHT rather than width.
@ -1753,6 +1773,12 @@ in
} }
} }
}
// Mid cluster: the server glance, pinned just above the
// bottom cluster. Its own anchor (not a barTop child) is the
// whole point: workspace count then changes nothing here.
//
// Server monitor: one persistent SSH streaming `top -b` // Server monitor: one persistent SSH streaming `top -b`
// from the mediaserver (2s ticks, parsed line by line // from the mediaserver (2s ticks, parsed line by line
// no per-poll reconnects) plus a streaming ping to the // no per-poll reconnects) plus a streaming ping to the
@ -1762,6 +1788,14 @@ in
id: srvWidget id: srvWidget
width: Theme.barWidth width: Theme.barWidth
height: srvGlanceCol.height height: srvGlanceCol.height
anchors.horizontalCenter: barBgRect.horizontalCenter
anchors.bottom: barBottom.top
anchors.bottomMargin: 20
// Fades out while the OSD takes this slot.
opacity: osdItem.shown ? 0 : 1
Behavior on opacity {
NumberAnimation { duration: Theme.animContent }
}
property bool connected: false property bool connected: false
property real cpu: 0 property real cpu: 0
@ -1939,11 +1973,10 @@ in
} }
} }
} }
}
// Bottom cluster: status icons, tray, power button. Anchored // Bottom cluster: status icons, tray, power button. Anchored
// to the bottom edge so the gap above it between here and the // to the bottom edge; the server glance sits just above it and
// workspace dots stays free as the OSD slot. // the OSD borrows that same slot while it is on screen.
Column { Column {
id: barBottom id: barBottom
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
@ -2294,7 +2327,7 @@ in
// Group separator: status icons / tray / power read // Group separator: status icons / tray / power read
// as three clusters instead of one clump. // as three clusters instead of one clump.
Item { width: Theme.barWidth; height: 10 } BarSep {}
// Tray icons stacked, like everything else in the column // Tray icons stacked, like everything else in the column
Column { Column {
@ -2382,7 +2415,7 @@ in
// Group separator: status icons / tray / power read // Group separator: status icons / tray / power read
// as three clusters instead of one clump. // as three clusters instead of one clump.
Item { width: Theme.barWidth; height: 10 } BarSep {}
// Power menu opener bottom-left corner. Opens the same // Power menu opener bottom-left corner. Opens the same
// session menu as Super+L, which now unfolds from here. // session menu as Super+L, which now unfolds from here.
@ -4168,10 +4201,12 @@ in
property real value: 0 property real value: 0
property color fill: Theme.base0D property color fill: Theme.base0D
// Takes over the server glance's slot: fixed position, no
// dependence on how tall the workspace column has grown.
width: Theme.barWidth width: Theme.barWidth
height: 170
anchors.horizontalCenter: barBgRect.horizontalCenter anchors.horizontalCenter: barBgRect.horizontalCenter
anchors.top: barTop.bottom anchors.verticalCenter: srvWidget.verticalCenter
anchors.bottom: barBottom.top
opacity: shown ? 1 : 0 opacity: shown ? 1 : 0
visible: opacity > 0.01 visible: opacity > 0.01