From 141ba96027ceb0b73b3788087a027f3b9ccc404f Mon Sep 17 00:00:00 2001 From: Lemmy Date: Fri, 20 Feb 2026 23:59:32 -0500 Subject: [PATCH] nbattery: increase width of graphical battery when at 100% --- Widgets/NBattery.qml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Widgets/NBattery.qml b/Widgets/NBattery.qml index 6a0065199..fea02b3ab 100644 --- a/Widgets/NBattery.qml +++ b/Widgets/NBattery.qml @@ -38,7 +38,20 @@ Item { // Internal sizing calculations based on baseSize readonly property real scaleFactor: baseSize / Style.fontSizeM - readonly property real bodyWidth: Style.toOdd(22 * scaleFactor) + readonly property real bodyWidth: { + const min = Style.toOdd(22 * scaleFactor); + if (!showPercentageText) { + return min; + } + + // increase length when showing 100% + if (percentage > 99) { + const max = Style.toOdd(30 * scaleFactor); + return max; + } + return min; + } + readonly property real bodyHeight: Style.toOdd(14 * scaleFactor) readonly property real terminalWidth: Math.round(2.5 * scaleFactor) readonly property real terminalHeight: Math.round(7 * scaleFactor)