1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-25 05:52:50 -05:00

Fixed an issue where the UI width was shifted due to the clock widget when using non-monospaced fonts. (#1491)

This commit is contained in:
Yamada.Kazuyoshi
2026-01-25 13:09:20 +09:00
committed by GitHub
parent 0d03e73595
commit f7df3b2a68

View File

@@ -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 {