From f7df3b2a685444ab8b44d38a286ddafe38bc2bff Mon Sep 17 00:00:00 2001 From: "Yamada.Kazuyoshi" Date: Sun, 25 Jan 2026 13:09:20 +0900 Subject: [PATCH] Fixed an issue where the UI width was shifted due to the clock widget when using non-monospaced fonts. (#1491) --- quickshell/Modules/DankBar/Widgets/Clock.qml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/quickshell/Modules/DankBar/Widgets/Clock.qml b/quickshell/Modules/DankBar/Widgets/Clock.qml index 0da7280c..9e09108b 100644 --- a/quickshell/Modules/DankBar/Widgets/Clock.qml +++ b/quickshell/Modules/DankBar/Widgets/Clock.qml @@ -211,6 +211,20 @@ BasePill { font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale) color: Theme.widgetTextColor anchors.baseline: dateText.baseline + width: timeTextMetrics.width + horizontalAlignment: Text.AlignHCenter + TextMetrics { + id: timeTextMetrics + font: timeText.font + text: { + const format = SettingsData.getEffectiveTimeFormat(); + if (SettingsData.use24HourClock) { + return SettingsData.showSeconds ? "88:88:88" : "88:88"; + } else { + return SettingsData.showSeconds ? "88:88:88 PM" : "88:88 PM"; + } + } + } } StyledText {