From d99ccaf5501f055befdfde7b380b36434d08348c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 18 May 2026 21:13:42 +0200 Subject: [PATCH] More power panel layouting --- shell/plugins/bar/widgets/powerPanel.qml | 36 ++++++++++++++++++------ 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/shell/plugins/bar/widgets/powerPanel.qml b/shell/plugins/bar/widgets/powerPanel.qml index aa4a7128..16b5adae 100644 --- a/shell/plugins/bar/widgets/powerPanel.qml +++ b/shell/plugins/bar/widgets/powerPanel.qml @@ -153,16 +153,24 @@ printf 'time\t%s\n' "$($OMARCHY_PATH/bin/omarchy-battery-remaining-time 2>/dev/n Text { text: root.modeLabel(); color: root.bar.foreground; font.family: root.bar.fontFamily; font.pixelSize: 13; font.bold: true } } - Grid { + Row { visible: root.batteryInfo.percentage !== undefined width: parent.width - columns: 2 - columnSpacing: 14 - rowSpacing: 4 - InfoLabel { text: "Percentage" } InfoValue { text: root.batteryInfo.percentage || "" } - InfoLabel { text: UPower.onBattery ? "Time left" : "Time to full" } InfoValue { text: root.batteryInfo.time || "—" } - InfoLabel { text: "Battery size" } InfoValue { text: root.batteryInfo.size || "" } - InfoLabel { text: UPower.onBattery ? "Draw" : "Charge rate" } InfoValue { text: root.batteryInfo.rate || "" } + spacing: 20 + + Column { + width: (parent.width - parent.spacing) / 2 + spacing: 4 + InfoPair { label: "Percentage"; value: root.batteryInfo.percentage || "" } + InfoPair { label: "Battery size"; value: root.batteryInfo.size || "" } + } + + Column { + width: (parent.width - parent.spacing) / 2 + spacing: 4 + InfoPair { label: UPower.onBattery ? "Time left" : "Time to full"; value: root.batteryInfo.time || "—" } + InfoPair { label: UPower.onBattery ? "Draw" : "Charge rate"; value: root.batteryInfo.rate || "" } + } } PanelSeparator { foreground: root.bar.foreground } @@ -200,6 +208,18 @@ printf 'time\t%s\n' "$($OMARCHY_PATH/bin/omarchy-battery-remaining-time 2>/dev/n } } + component InfoPair: Row { + property string label: "" + property string value: "" + + width: parent.width + spacing: 8 + + InfoLabel { text: label } + Item { width: Math.max(0, parent.width - parent.children[0].implicitWidth - parent.children[2].implicitWidth - parent.spacing * 2); height: 1 } + InfoValue { text: value } + } + component InfoLabel: Text { color: Qt.darker(root.bar.foreground, 1.4) font.family: root.bar.fontFamily