final theme

This commit is contained in:
2026-08-11 02:05:46 +02:00
parent 105cf6b3a8
commit 08146fe16f
5 changed files with 174 additions and 39 deletions
+50 -26
View File
@@ -9,7 +9,11 @@ Popout {
id: root
contentWidth: 310
contentHeight: 296
// Derived: the charge block is a different height from the dial it
// replaced, and the health line comes and goes.
contentHeight: header.height + Theme.padM + readout.height + Theme.padM
+ bar.height + Theme.padM + detailText.implicitHeight + Theme.padL
+ suspendButton.height + Theme.padM * 2
PopoutSurface {
anchors.fill: parent
@@ -26,27 +30,42 @@ Popout {
subtitle: Battery.charging ? "CHARGING" : (Battery.onBattery ? "ON BATTERY" : "AC")
}
Row {
// The dial that used to sit here duplicated the meter below it and was
// the only curve in the shell. The charge is now simply set large, and
// the MeterBar underneath is left to carry the level on its own.
Item {
id: readout
anchors.top: header.bottom
anchors.topMargin: Theme.padM
anchors.left: parent.left
anchors.right: parent.right
spacing: Theme.padM
height: Math.max(charge.height, detail.height)
Gauge {
width: 92; height: 92
value: Battery.percent
label: "CHARGE"
arcColor: Battery.tint
readout: Math.round(Battery.percent) + "%"
Column {
id: charge
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
// No "CHARGE" caption under the number. It landed directly on
// top of the meter, and between the header and a full-width
// charge bar there was nothing left for it to disambiguate.
SplitText {
text: Math.round(Battery.percent) + "%"
pixelSize: Theme.fsHuge
color: Battery.tint
split: 2.5
splitOpacity: 0.7
}
}
Column {
id: detail
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
spacing: Theme.padS
SplitText {
anchors.right: parent.right
horizontalAlignment: Text.AlignRight
text: Battery.timeLabel
pixelSize: Theme.fsBody
split: 1.1
@@ -57,6 +76,8 @@ Popout {
text: Battery.changeRate > 0
? Battery.changeRate.toFixed(1) + " W " + (Battery.charging ? "in" : "draw")
: "idle"
anchors.right: parent.right
horizontalAlignment: Text.AlignRight
color: Theme.subtext
font.family: Theme.fontMono
font.pixelSize: Theme.fsSmall
@@ -66,6 +87,8 @@ Popout {
Text {
visible: Battery.health > 0
text: "Health " + Math.round(Battery.health) + "%"
anchors.right: parent.right
horizontalAlignment: Text.AlignRight
color: Battery.health < 70 ? Theme.warn : Theme.muted
font.family: Theme.fontMono
font.pixelSize: Theme.fsMicro
@@ -88,9 +111,26 @@ Popout {
activeColor: Battery.tint
}
Text {
id: detailText
anchors.top: bar.bottom
anchors.topMargin: Theme.padM
anchors.left: parent.left
anchors.right: parent.right
text: Battery.detail
wrapMode: Text.WordWrap
color: Theme.muted
font.family: Theme.fontMono
font.pixelSize: Theme.fsMicro
renderType: Text.NativeRendering
}
// Follows the detail line rather than being pinned to the bottom of a
// fixed-height panel, which is what left a dead band above it.
P5Button {
id: suspendButton
anchors.bottom: parent.bottom
anchors.top: detailText.bottom
anchors.topMargin: Theme.padL
anchors.left: parent.left
text: "Suspend"
icon: "󰤄"
@@ -99,21 +139,5 @@ Popout {
Actions.suspend();
}
}
Text {
anchors.top: bar.bottom
anchors.topMargin: Theme.padS
anchors.bottom: suspendButton.top
anchors.bottomMargin: Theme.padS
anchors.left: parent.left
anchors.right: parent.right
text: Battery.detail
wrapMode: Text.WordWrap
verticalAlignment: Text.AlignTop
color: Theme.muted
font.family: Theme.fontMono
font.pixelSize: Theme.fsMicro
renderType: Text.NativeRendering
}
}
}
+20 -13
View File
@@ -9,7 +9,12 @@ Popout {
id: root
contentWidth: 420
contentHeight: 268
// Derived rather than a fixed number: the meters are taller than the dials
// they replaced, and the GPU block disappears entirely on machines without
// one. A hardcoded height would either clip or leave a hole.
contentHeight: header.height + Theme.padM
+ gauges.implicitHeight + Theme.padL
+ details.implicitHeight + Theme.padM * 2
PopoutSurface {
anchors.fill: parent
@@ -26,37 +31,38 @@ Popout {
subtitle: "UP " + Sys.uptime + " · " + Sys.procs + " PROCS"
}
Row {
Column {
id: gauges
anchors.top: header.bottom
anchors.topMargin: Theme.padM
anchors.horizontalCenter: parent.horizontalCenter
anchors.left: parent.left
anchors.right: parent.right
spacing: Theme.padM
Gauge {
width: 88; height: 88
MetricRow {
width: parent.width
value: Sys.cpuUsage
label: "CPU"
sub: Math.round(Sys.cpuTemp) + "°C"
}
Gauge {
width: 88; height: 88
MetricRow {
width: parent.width
value: Sys.memPercent
label: "MEM"
sub: Sys.gb(Sys.memUsed) + "/" + Sys.gb(Sys.memTotal)
sub: Sys.gb(Sys.memUsed) + " / " + Sys.gb(Sys.memTotal)
}
Gauge {
width: 88; height: 88
MetricRow {
width: parent.width
visible: Sys.gpuAvailable
value: Sys.gpuUsage
label: "GPU"
sub: Math.round(Sys.gpuTemp) + "°C"
}
Gauge {
width: 88; height: 88
MetricRow {
width: parent.width
value: Sys.diskPercent
label: "DISK"
sub: Sys.diskFree + " free"
@@ -64,8 +70,9 @@ Popout {
}
Column {
id: details
anchors.top: gauges.bottom
anchors.topMargin: Theme.padM
anchors.topMargin: Theme.padL
anchors.left: parent.left
anchors.right: parent.right
spacing: 3