From 9f54822e4c2e3108373e455f118ae00e3a74c29d Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Sun, 12 Oct 2025 15:48:52 -0400 Subject: [PATCH] Different scaling for Bar and Panels --- Commons/Style.qml | 2 +- Modules/Bar/Bluetooth/BluetoothPanel.qml | 4 ++-- Modules/Bar/Calendar/CalendarPanel.qml | 10 +++++----- Modules/Bar/Extras/BarPillHorizontal.qml | 1 + Modules/Bar/Extras/BarPillVertical.qml | 1 + Modules/Bar/WiFi/WiFiPanel.qml | 8 ++++---- Modules/Bar/Widgets/ActiveWindow.qml | 4 ++++ Modules/Bar/Widgets/Clock.qml | 2 ++ Modules/Bar/Widgets/MediaMini.qml | 3 +++ Modules/Bar/Widgets/SystemMonitor.qml | 12 ++++++++++++ Modules/Bar/Widgets/Workspace.qml | 2 ++ Modules/Settings/SettingsPanel.qml | 4 ++-- Widgets/NIcon.qml | 3 ++- Widgets/NText.qml | 7 ++++++- 14 files changed, 47 insertions(+), 16 deletions(-) diff --git a/Commons/Style.qml b/Commons/Style.qml index 3b09b3a01..954cb33e3 100644 --- a/Commons/Style.qml +++ b/Commons/Style.qml @@ -51,7 +51,7 @@ Singleton { property int marginL: Math.round(13 * uiScaleRatio) property int marginXL: Math.round(18 * uiScaleRatio) - property real uiScaleRatio: 0.8 + property real uiScaleRatio: 1.2 // Opacity property real opacityNone: 0.0 diff --git a/Modules/Bar/Bluetooth/BluetoothPanel.qml b/Modules/Bar/Bluetooth/BluetoothPanel.qml index a1be312ef..7e08efef2 100644 --- a/Modules/Bar/Bluetooth/BluetoothPanel.qml +++ b/Modules/Bar/Bluetooth/BluetoothPanel.qml @@ -11,8 +11,8 @@ import qs.Widgets NPanel { id: root - preferredWidth: 380 - preferredHeight: 500 + preferredWidth: 380 * Style.uiScaleRatio + preferredHeight: 500 * Style.uiScaleRatio panelKeyboardFocus: true panelContent: Rectangle { diff --git a/Modules/Bar/Calendar/CalendarPanel.qml b/Modules/Bar/Calendar/CalendarPanel.qml index 642a27001..6b3af61b4 100644 --- a/Modules/Bar/Calendar/CalendarPanel.qml +++ b/Modules/Bar/Calendar/CalendarPanel.qml @@ -10,8 +10,8 @@ import qs.Widgets NPanel { id: root - preferredWidth: Settings.data.location.showWeekNumberInCalendar ? 400 : 380 - preferredHeight: 520 + preferredWidth: (Settings.data.location.showWeekNumberInCalendar ? 400 : 380) * Style.uiScaleRatio + preferredHeight: 520 * Style.uiScaleRatio panelContent: ColumnLayout { id: content @@ -55,7 +55,7 @@ NPanel { // Combined layout for weather icon, date, and weather text RowLayout { Layout.fillWidth: true - height: 60 + height: 60 * Style.uiScaleRatio clip: true spacing: Style.marginS @@ -119,7 +119,7 @@ NPanel { // Month, year, location ColumnLayout { - Layout.preferredWidth: 170 + Layout.preferredWidth: 170 * Style.uiScaleRatio Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft Layout.bottomMargin: Style.marginXXS Layout.topMargin: -Style.marginXXS @@ -186,7 +186,7 @@ NPanel { anchors.right: parent.right anchors.rightMargin: Style.marginM anchors.verticalCenter: parent.verticalCenter - height: Math.round((Style.fontSizeXXXL * 1.9) / 2) * 2 + height: Math.round((Style.fontSizeXXXL * 1.9) / 2 * Style.uiScaleRatio) * 2 width: clockItem.height // Seconds circular progress diff --git a/Modules/Bar/Extras/BarPillHorizontal.qml b/Modules/Bar/Extras/BarPillHorizontal.qml index c24f58e99..597d02f9f 100644 --- a/Modules/Bar/Extras/BarPillHorizontal.qml +++ b/Modules/Bar/Extras/BarPillHorizontal.qml @@ -90,6 +90,7 @@ Item { text: root.text + root.suffix family: Settings.data.ui.fontFixed pointSize: textSize + applyUiScale: false font.weight: Style.fontWeightBold color: forceOpen ? Color.mOnSurface : Color.mPrimary visible: revealed diff --git a/Modules/Bar/Extras/BarPillVertical.qml b/Modules/Bar/Extras/BarPillVertical.qml index 3feed7e61..7c0b5e77e 100644 --- a/Modules/Bar/Extras/BarPillVertical.qml +++ b/Modules/Bar/Extras/BarPillVertical.qml @@ -102,6 +102,7 @@ Item { text: root.text + root.suffix family: Settings.data.ui.fontFixed pointSize: textSize + applyUiScale: false font.weight: Style.fontWeightMedium horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter diff --git a/Modules/Bar/WiFi/WiFiPanel.qml b/Modules/Bar/WiFi/WiFiPanel.qml index 4b19145ff..9bab6f254 100644 --- a/Modules/Bar/WiFi/WiFiPanel.qml +++ b/Modules/Bar/WiFi/WiFiPanel.qml @@ -10,8 +10,8 @@ import qs.Widgets NPanel { id: root - preferredWidth: 400 - preferredHeight: 500 + preferredWidth: 400 * Style.uiScaleRatio + preferredHeight: 500 * Style.uiScaleRatio panelKeyboardFocus: true property string passwordSsid: "" @@ -173,7 +173,7 @@ NPanel { NText { text: I18n.tr("wifi.panel.searching") - pointSize: Style.fontSizeNormal + pointSize: Style.fontSizeM color: Color.mOnSurfaceVariant Layout.alignment: Qt.AlignHCenter } @@ -252,7 +252,7 @@ NPanel { NText { text: modelData.ssid - pointSize: Style.fontSizeNormal + pointSize: Style.fontSizeM font.weight: modelData.connected ? Style.fontWeightBold : Style.fontWeightMedium color: Color.mOnSurface elide: Text.ElideRight diff --git a/Modules/Bar/Widgets/ActiveWindow.qml b/Modules/Bar/Widgets/ActiveWindow.qml index 63248e921..7ff5b7b6c 100644 --- a/Modules/Bar/Widgets/ActiveWindow.qml +++ b/Modules/Bar/Widgets/ActiveWindow.qml @@ -107,6 +107,7 @@ Item { visible: false text: windowTitle pointSize: Style.fontSizeS + applyUiScale: false font.weight: Style.fontWeightMedium } @@ -244,6 +245,7 @@ Item { id: titleText text: windowTitle pointSize: Style.fontSizeS + applyUiScale: false font.weight: Style.fontWeightMedium verticalAlignment: Text.AlignVCenter color: Color.mOnSurface @@ -253,6 +255,8 @@ Item { NText { text: windowTitle font: titleText.font + pointSize: Style.fontSizeS + applyUiScale: false verticalAlignment: Text.AlignVCenter color: Color.mOnSurface visible: titleContainer.needsScrolling && titleContainer.isScrolling diff --git a/Modules/Bar/Widgets/Clock.qml b/Modules/Bar/Widgets/Clock.qml index e775b882a..3058f5288 100644 --- a/Modules/Bar/Widgets/Clock.qml +++ b/Modules/Bar/Widgets/Clock.qml @@ -73,6 +73,7 @@ Rectangle { return (index == 0) ? Style.fontSizeXS : Style.fontSizeXXS } } + applyUiScale: false font.weight: Style.fontWeightBold color: usePrimaryColor ? Color.mPrimary : Color.mOnSurface wrapMode: Text.WordWrap @@ -97,6 +98,7 @@ Rectangle { text: modelData family: useCustomFont && customFont ? customFont : Settings.data.ui.fontDefault pointSize: Style.fontSizeS + applyUiScale: false font.weight: Style.fontWeightBold color: usePrimaryColor ? Color.mPrimary : Color.mOnSurface wrapMode: Text.WordWrap diff --git a/Modules/Bar/Widgets/MediaMini.qml b/Modules/Bar/Widgets/MediaMini.qml index 4973e8b85..7cab104f1 100644 --- a/Modules/Bar/Widgets/MediaMini.qml +++ b/Modules/Bar/Widgets/MediaMini.qml @@ -84,6 +84,7 @@ Item { visible: false text: titleText.text font: titleText.font + applyUiScale: false } Rectangle { @@ -286,6 +287,7 @@ Item { id: titleText text: hasActivePlayer ? getTitle() : placeholderText pointSize: Style.fontSizeS + applyUiScale: false font.weight: Style.fontWeightMedium verticalAlignment: Text.AlignVCenter horizontalAlignment: hasActivePlayer ? Text.AlignLeft : Text.AlignHCenter @@ -295,6 +297,7 @@ Item { NText { text: hasActivePlayer ? getTitle() : placeholderText font: titleText.font + applyUiScale: false verticalAlignment: Text.AlignVCenter horizontalAlignment: hasActivePlayer ? Text.AlignLeft : Text.AlignHCenter color: hasActivePlayer ? Color.mOnSurface : Color.mOnSurfaceVariant diff --git a/Modules/Bar/Widgets/SystemMonitor.qml b/Modules/Bar/Widgets/SystemMonitor.qml index 699512dc2..f624fcfea 100644 --- a/Modules/Bar/Widgets/SystemMonitor.qml +++ b/Modules/Bar/Widgets/SystemMonitor.qml @@ -106,6 +106,7 @@ Rectangle { NIcon { icon: "cpu-usage" pointSize: iconSize + applyUiScale: false Layout.alignment: Qt.AlignCenter Layout.row: isVertical ? 1 : 0 Layout.column: 0 @@ -115,6 +116,7 @@ Rectangle { text: `${Math.round(SystemStatService.cpuUsage)}%` family: Settings.data.ui.fontFixed pointSize: textSize + applyUiScale: false font.weight: Style.fontWeightMedium Layout.alignment: Qt.AlignCenter Layout.preferredWidth: isVertical ? -1 : percentTextWidth @@ -147,6 +149,7 @@ Rectangle { NIcon { icon: "cpu-temperature" pointSize: iconSize + applyUiScale: false Layout.alignment: Qt.AlignCenter Layout.row: isVertical ? 1 : 0 Layout.column: 0 @@ -156,6 +159,7 @@ Rectangle { text: `${Math.round(SystemStatService.cpuTemp)}°` family: Settings.data.ui.fontFixed pointSize: textSize + applyUiScale: false font.weight: Style.fontWeightMedium Layout.alignment: Qt.AlignCenter Layout.preferredWidth: isVertical ? -1 : tempTextWidth @@ -188,6 +192,7 @@ Rectangle { NIcon { icon: "memory" pointSize: iconSize + applyUiScale: false Layout.alignment: Qt.AlignCenter Layout.row: isVertical ? 1 : 0 Layout.column: 0 @@ -197,6 +202,7 @@ Rectangle { text: showMemoryAsPercent ? `${Math.round(SystemStatService.memPercent)}%` : `${SystemStatService.memGb.toFixed(1)}G` family: Settings.data.ui.fontFixed pointSize: textSize + applyUiScale: false font.weight: Style.fontWeightMedium Layout.alignment: Qt.AlignCenter Layout.preferredWidth: isVertical ? -1 : (showMemoryAsPercent ? percentTextWidth : memTextWidth) @@ -229,6 +235,7 @@ Rectangle { NIcon { icon: "download-speed" pointSize: iconSize + applyUiScale: false Layout.alignment: Qt.AlignCenter Layout.row: isVertical ? 1 : 0 Layout.column: 0 @@ -238,6 +245,7 @@ Rectangle { text: isVertical ? SystemStatService.formatCompactSpeed(SystemStatService.rxSpeed) : SystemStatService.formatSpeed(SystemStatService.rxSpeed) family: Settings.data.ui.fontFixed pointSize: textSize + applyUiScale: false font.weight: Style.fontWeightMedium Layout.alignment: Qt.AlignCenter Layout.preferredWidth: isVertical ? -1 : memTextWidth @@ -270,6 +278,7 @@ Rectangle { NIcon { icon: "upload-speed" pointSize: iconSize + applyUiScale: false Layout.alignment: Qt.AlignCenter Layout.row: isVertical ? 1 : 0 Layout.column: 0 @@ -279,6 +288,7 @@ Rectangle { text: isVertical ? SystemStatService.formatCompactSpeed(SystemStatService.txSpeed) : SystemStatService.formatSpeed(SystemStatService.txSpeed) family: Settings.data.ui.fontFixed pointSize: textSize + applyUiScale: false font.weight: Style.fontWeightMedium Layout.alignment: Qt.AlignCenter Layout.preferredWidth: isVertical ? -1 : memTextWidth @@ -311,6 +321,7 @@ Rectangle { NIcon { icon: "storage" pointSize: iconSize + applyUiScale: false Layout.alignment: Qt.AlignCenter Layout.row: isVertical ? 1 : 0 Layout.column: 0 @@ -320,6 +331,7 @@ Rectangle { text: `${SystemStatService.diskPercent}%` family: Settings.data.ui.fontFixed pointSize: textSize + applyUiScale: false font.weight: Style.fontWeightMedium Layout.alignment: Qt.AlignCenter Layout.preferredWidth: isVertical ? -1 : percentTextWidth diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index c0149cf46..2cb700ef4 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -286,6 +286,7 @@ Item { } family: Settings.data.ui.fontFixed pointSize: model.isFocused ? workspacePillContainer.height * 0.45 : workspacePillContainer.height * 0.42 + applyUiScale: false font.capitalization: Font.AllUppercase font.weight: Style.fontWeightBold wrapMode: Text.Wrap @@ -430,6 +431,7 @@ Item { } family: Settings.data.ui.fontFixed pointSize: model.isFocused ? workspacePillContainerVertical.width * 0.45 : workspacePillContainerVertical.width * 0.42 + applyUiScale: false font.capitalization: Font.AllUppercase font.weight: Style.fontWeightBold wrapMode: Text.Wrap diff --git a/Modules/Settings/SettingsPanel.qml b/Modules/Settings/SettingsPanel.qml index 12869efd4..0a5a71f57 100644 --- a/Modules/Settings/SettingsPanel.qml +++ b/Modules/Settings/SettingsPanel.qml @@ -11,8 +11,8 @@ import qs.Widgets NPanel { id: root - preferredWidth: 800 - preferredHeight: 800 + preferredWidth: 800 * Style.uiScaleRatio + preferredHeight: 800 * Style.uiScaleRatio preferredWidthRatio: 0.4 preferredHeightRatio: 0.75 diff --git a/Widgets/NIcon.qml b/Widgets/NIcon.qml index 65cfa9b52..87e63c1f5 100644 --- a/Widgets/NIcon.qml +++ b/Widgets/NIcon.qml @@ -8,6 +8,7 @@ Text { property string icon: Icons.defaultIcon property real pointSize: Style.fontSizeL + property bool applyUiScale: true visible: (icon !== undefined) && (icon !== "") text: { @@ -22,7 +23,7 @@ Text { return Icons.get(icon) } font.family: Icons.fontFamily - font.pointSize: root.pointSize * Style.uiScaleRatio + font.pointSize: applyUiScale ? root.pointSize * Style.uiScaleRatio : root.pointSize color: Color.mOnSurface verticalAlignment: Text.AlignVCenter } diff --git a/Widgets/NText.qml b/Widgets/NText.qml index 9069f2411..4a9060ed9 100644 --- a/Widgets/NText.qml +++ b/Widgets/NText.qml @@ -9,8 +9,13 @@ Text { property string family: Settings.data.ui.fontDefault property real pointSize: Style.fontSizeM + property bool applyUiScale: true property real fontScale: { - return (root.family === Settings.data.ui.fontDefault ? Settings.data.ui.fontDefaultScale * Style.uiScaleRatio: Settings.data.ui.fontFixedScale * Style.uiScaleRatio) + const fontScale = (root.family === Settings.data.ui.fontDefault ? Settings.data.ui.fontDefaultScale : Settings.data.ui.fontFixedScale) + if (applyUiScale) { + return fontScale * Style.uiScaleRatio + } + return fontScale } font.family: root.family