From cf3c76a79fea10f0f6edef339572bee719b6a453 Mon Sep 17 00:00:00 2001 From: bbedward Date: Fri, 4 Sep 2026 13:10:37 -0400 Subject: [PATCH] bar: keep the widget font size the user asked for ref #3295 port 1.6 --- quickshell/Common/Theme.qml | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/quickshell/Common/Theme.qml b/quickshell/Common/Theme.qml index 18a2ce5c0..b5e184615 100644 --- a/quickshell/Common/Theme.qml +++ b/quickshell/Common/Theme.qml @@ -1522,30 +1522,10 @@ Singleton { const dankBarScale = fontScale !== undefined ? fontScale : 1.0; const maxScale = (maximizeText ?? false) ? 1.5 : 1.0; if (scale <= 0.75) - return evenLineBoxSize(Math.round(fontSizeSmall * 0.9 * dankBarScale * maxScale)); + return Math.round(fontSizeSmall * 0.9 * dankBarScale * maxScale); if (scale >= 1.25) - return evenLineBoxSize(Math.round(fontSizeMedium * dankBarScale * maxScale)); - return evenLineBoxSize(Math.round(fontSizeSmall * dankBarScale * maxScale)); - } - - FontMetrics { - id: lineBoxProbe - } - - // Text.implicitHeight is ceil(FontMetrics.height); probe.font is written whole and read via boundingRect() so bindings capture no dependency on the probe - function lineBoxHeight(pixelSize) { - lineBoxProbe.font = Qt.font({ - family: fontFamily, - weight: fontWeight, - pixelSize: pixelSize - }); - return Math.ceil(lineBoxProbe.boundingRect("0").height); - } - - function evenLineBoxSize(pixelSize) { - if (lineBoxHeight(pixelSize) % 2 === 0) - return pixelSize; - return lineBoxHeight(pixelSize + 1) % 2 === 0 ? pixelSize + 1 : pixelSize; + return Math.round(fontSizeMedium * dankBarScale * maxScale); + return Math.round(fontSizeSmall * dankBarScale * maxScale); } function getBatteryIcon(level, isCharging, batteryAvailable) {