From f2deaeccdb6cca69011a615d65d15b352f9740af Mon Sep 17 00:00:00 2001 From: bbedward Date: Sun, 16 Nov 2025 15:56:59 -0500 Subject: [PATCH] scaling: snap value reported by wlr-output --- quickshell/Common/Theme.qml | 14 +++++++------- quickshell/Modules/DankBar/Widgets/Clock.qml | 16 +++------------- quickshell/Services/CompositorService.qml | 2 +- quickshell/Widgets/StyledText.qml | 3 +-- 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/quickshell/Common/Theme.qml b/quickshell/Common/Theme.qml index a2463181..c2ab4eb5 100644 --- a/quickshell/Common/Theme.qml +++ b/quickshell/Common/Theme.qml @@ -455,10 +455,10 @@ Singleton { property real spacingM: 12 property real spacingL: 16 property real spacingXL: 24 - property real fontSizeSmall: fontScale * 12 - property real fontSizeMedium: fontScale * 14 - property real fontSizeLarge: fontScale * 16 - property real fontSizeXLarge: fontScale * 20 + property real fontSizeSmall: Math.round(fontScale * 12) + property real fontSizeMedium: Math.round(fontScale * 14) + property real fontSizeLarge: Math.round(fontScale * 16) + property real fontSizeXLarge: Math.round(fontScale * 20) property real barHeight: 48 property real iconSize: 24 property real iconSizeSmall: 16 @@ -679,10 +679,10 @@ Singleton { const scale = barThickness / 48 const dankBarScale = (typeof SettingsData !== "undefined" ? SettingsData.dankBarFontScale : 1.0) if (scale <= 0.75) - return fontSizeSmall * 0.9 * dankBarScale + return Math.round(fontSizeSmall * 0.9 * dankBarScale) if (scale >= 1.25) - return fontSizeMedium * dankBarScale - return fontSizeSmall * dankBarScale + return Math.round(fontSizeMedium * dankBarScale) + return Math.round(fontSizeSmall * dankBarScale) } function getBatteryIcon(level, isCharging, batteryAvailable) { diff --git a/quickshell/Modules/DankBar/Widgets/Clock.qml b/quickshell/Modules/DankBar/Widgets/Clock.qml index 3099c6d0..2763447f 100644 --- a/quickshell/Modules/DankBar/Widgets/Clock.qml +++ b/quickshell/Modules/DankBar/Widgets/Clock.qml @@ -19,7 +19,7 @@ BasePill { id: clockColumn visible: root.isVerticalOrientation anchors.centerIn: parent - spacing: -2 + spacing: 0 Row { spacing: 0 @@ -37,7 +37,6 @@ BasePill { } font.pixelSize: Theme.barTextSize(root.barThickness) color: Theme.surfaceText - width: 9 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignBottom } @@ -54,7 +53,6 @@ BasePill { } font.pixelSize: Theme.barTextSize(root.barThickness) color: Theme.surfaceText - width: 9 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignBottom } @@ -68,7 +66,6 @@ BasePill { text: String(systemClock?.date?.getMinutes()).padStart(2, '0').charAt(0) font.pixelSize: Theme.barTextSize(root.barThickness) color: Theme.surfaceText - width: 9 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignBottom } @@ -77,7 +74,6 @@ BasePill { text: String(systemClock?.date?.getMinutes()).padStart(2, '0').charAt(1) font.pixelSize: Theme.barTextSize(root.barThickness) color: Theme.surfaceText - width: 9 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignBottom } @@ -92,7 +88,6 @@ BasePill { text: String(systemClock?.date?.getSeconds()).padStart(2, '0').charAt(0) font.pixelSize: Theme.barTextSize(root.barThickness) color: Theme.surfaceText - width: 9 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignBottom } @@ -101,19 +96,18 @@ BasePill { text: String(systemClock?.date?.getSeconds()).padStart(2, '0').charAt(1) font.pixelSize: Theme.barTextSize(root.barThickness) color: Theme.surfaceText - width: 9 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignBottom } } Item { - width: 12 + width: parent.width height: Theme.spacingM anchors.horizontalCenter: parent.horizontalCenter Rectangle { - width: 12 + width: parent.width * 0.6 height: 1 color: Theme.outlineButton anchors.centerIn: parent @@ -134,7 +128,6 @@ BasePill { } font.pixelSize: Theme.barTextSize(root.barThickness) color: Theme.primary - width: 9 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignBottom } @@ -149,7 +142,6 @@ BasePill { } font.pixelSize: Theme.barTextSize(root.barThickness) color: Theme.primary - width: 9 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignBottom } @@ -169,7 +161,6 @@ BasePill { } font.pixelSize: Theme.barTextSize(root.barThickness) color: Theme.primary - width: 9 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignBottom } @@ -184,7 +175,6 @@ BasePill { } font.pixelSize: Theme.barTextSize(root.barThickness) color: Theme.primary - width: 9 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignBottom } diff --git a/quickshell/Services/CompositorService.qml b/quickshell/Services/CompositorService.qml index e239d51e..79a45494 100644 --- a/quickshell/Services/CompositorService.qml +++ b/quickshell/Services/CompositorService.qml @@ -38,7 +38,7 @@ Singleton { if (WlrOutputService.wlrOutputAvailable && screen) { const wlrOutput = WlrOutputService.getOutput(screen.name) if (wlrOutput?.enabled && wlrOutput.scale !== undefined && wlrOutput.scale > 0) { - return wlrOutput.scale + return Math.round(wlrOutput.scale * 20) / 20 } } diff --git a/quickshell/Widgets/StyledText.qml b/quickshell/Widgets/StyledText.qml index 773922e8..5d307bc0 100644 --- a/quickshell/Widgets/StyledText.qml +++ b/quickshell/Widgets/StyledText.qml @@ -38,8 +38,7 @@ Text { wrapMode: Text.WordWrap elide: Text.ElideRight verticalAlignment: Text.AlignVCenter - antialiasing: true - renderType: Text.NativeRendering + //renderType: Text.NativeRendering Behavior on opacity { NumberAnimation {