quickshell: server glance under workspaces, sliders get knobs
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
36e9b00782
commit
ce14f695c6
1 changed files with 27 additions and 17 deletions
|
|
@ -772,14 +772,17 @@ in
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── PillSlider: slim rounded track + fill with a full-height
|
// ── PillSlider: rounded track + fill + knob with a full-height
|
||||||
// invisible hit area. `value` is 0..1; `moved(v)` fires on drag.
|
// invisible hit area. `value` is 0..1; `moved(v)` fires on drag.
|
||||||
|
// Knob diameter derives from the track, so the small app-stream
|
||||||
|
// variants scale with just a trackH override.
|
||||||
component PillSlider: Item {
|
component PillSlider: Item {
|
||||||
property real value: 0
|
property real value: 0
|
||||||
property color fillColor: Theme.base0D
|
property color fillColor: Theme.base0D
|
||||||
property real trackH: 6
|
property real trackH: 8
|
||||||
|
readonly property real knobD: trackH + 8
|
||||||
signal moved(real v)
|
signal moved(real v)
|
||||||
height: 20
|
height: 22
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
@ -795,6 +798,15 @@ in
|
||||||
color: parent.fillColor
|
color: parent.fillColor
|
||||||
Behavior on width { NumberAnimation { duration: 80 } }
|
Behavior on width { NumberAnimation { duration: 80 } }
|
||||||
}
|
}
|
||||||
|
Rectangle {
|
||||||
|
width: parent.knobD
|
||||||
|
height: parent.knobD
|
||||||
|
radius: parent.knobD / 2
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
x: Math.max(0, Math.min(parent.width - parent.knobD, parent.value * parent.width - parent.knobD / 2))
|
||||||
|
color: Theme.base06
|
||||||
|
Behavior on x { NumberAnimation { duration: 80 } }
|
||||||
|
}
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
function set(mouse) { parent.moved(Math.max(0, Math.min(1, mouse.x / width))); }
|
function set(mouse) { parent.moved(Math.max(0, Math.min(1, mouse.x / width))); }
|
||||||
|
|
@ -1458,22 +1470,11 @@ in
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// ── Bottom cluster: status icons, tray, power button. Anchored
|
|
||||||
// to the bottom edge so the gap above it — between here and the
|
|
||||||
// workspace dots — stays free as the OSD slot.
|
|
||||||
Column {
|
|
||||||
id: barBottom
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.bottomMargin: 12
|
|
||||||
anchors.horizontalCenter: barBgRect.horizontalCenter
|
|
||||||
spacing: 16
|
|
||||||
|
|
||||||
// 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
|
||||||
// router. Glance = CPU/RAM mini meters + ping ms; click
|
// router. Glance = CPU/RAM numbers + ping ms; click
|
||||||
// opens the btop-style dropdown.
|
// opens the btop-style dropdown.
|
||||||
Item {
|
Item {
|
||||||
id: srvWidget
|
id: srvWidget
|
||||||
|
|
@ -1612,6 +1613,17 @@ in
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Bottom cluster: status icons, tray, power button. Anchored
|
||||||
|
// to the bottom edge so the gap above it — between here and the
|
||||||
|
// workspace dots — stays free as the OSD slot.
|
||||||
|
Column {
|
||||||
|
id: barBottom
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.bottomMargin: 12
|
||||||
|
anchors.horizontalCenter: barBgRect.horizontalCenter
|
||||||
|
spacing: 16
|
||||||
|
|
||||||
// Volume
|
// Volume
|
||||||
Item {
|
Item {
|
||||||
|
|
@ -2532,7 +2544,6 @@ in
|
||||||
SText { width: 42; text: "cpu"; color: Theme.base04; anchors.verticalCenter: parent.verticalCenter }
|
SText { width: 42; text: "cpu"; color: Theme.base04; anchors.verticalCenter: parent.verticalCenter }
|
||||||
PillSlider {
|
PillSlider {
|
||||||
width: parent.width - 42 - 76 - 20
|
width: parent.width - 42 - 76 - 20
|
||||||
height: 22; trackH: 6
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
value: srvWidget.cpu / 100
|
value: srvWidget.cpu / 100
|
||||||
fillColor: srvWidget.cpu >= 90 ? Theme.base08 : Theme.base0D
|
fillColor: srvWidget.cpu >= 90 ? Theme.base08 : Theme.base0D
|
||||||
|
|
@ -2552,7 +2563,6 @@ in
|
||||||
SText { width: 42; text: "ram"; color: Theme.base04; anchors.verticalCenter: parent.verticalCenter }
|
SText { width: 42; text: "ram"; color: Theme.base04; anchors.verticalCenter: parent.verticalCenter }
|
||||||
PillSlider {
|
PillSlider {
|
||||||
width: parent.width - 42 - 76 - 20
|
width: parent.width - 42 - 76 - 20
|
||||||
height: 22; trackH: 6
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
value: srvWidget.memTotal > 0 ? srvWidget.memUsed / srvWidget.memTotal : 0
|
value: srvWidget.memTotal > 0 ? srvWidget.memUsed / srvWidget.memTotal : 0
|
||||||
fillColor: Theme.base0C
|
fillColor: Theme.base0C
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue