nbattery: increase width of graphical battery when at 100%

This commit is contained in:
Lemmy
2026-02-20 23:59:32 -05:00
parent f240a7ca2c
commit 141ba96027
+14 -1
View File
@@ -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)