From 5a47f88d4852a38b7a892e9a737f18714fc03386 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Sun, 12 Oct 2025 16:54:36 -0400 Subject: [PATCH] Dont scale NIconButton in the bar --- Assets/Translations/en.json | 2 +- Assets/Translations/pt.json | 2 +- Modules/Bar/Extras/BarPillHorizontal.qml | 1 + Modules/Bar/Extras/BarPillVertical.qml | 1 + Modules/Bar/Extras/TrayMenu.qml | 1 + Modules/Bar/Widgets/Bluetooth.qml | 1 + Modules/Bar/Widgets/ControlCenter.qml | 1 + Modules/Bar/Widgets/DarkMode.qml | 1 + Modules/Bar/Widgets/KeepAwake.qml | 1 + Modules/Bar/Widgets/NightLight.qml | 1 + Modules/Bar/Widgets/NotificationHistory.qml | 1 + Modules/Bar/Widgets/PowerProfile.qml | 4 ++-- Modules/Bar/Widgets/ScreenRecorder.qml | 1 + Modules/Bar/Widgets/SessionMenu.qml | 1 + Modules/Bar/Widgets/WallpaperSelector.qml | 1 + Modules/Bar/Widgets/WiFi.qml | 1 + Widgets/NIconButton.qml | 8 +++++--- 17 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 618a251ed..1ce1a9381 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -23,7 +23,7 @@ "description": "Enable or disable tooltips throughout the interface." }, "scaling": { - "label": "Interface Scaling", + "label": "Interface scaling", "description": "Changes the size of the general user interface, excluding the bar.", "reset-scaling": "Reset interface scaling" }, diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index 7c1807f4f..6f00f9f1d 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -46,7 +46,7 @@ }, "scaling": { "description": "Altera o tamanho da interface geral do usuário, excluindo a barra.", - "label": "Escalonamento da Interface", + "label": "Escalonamento da interface", "reset-scaling": "Redefinir escala da interface" } }, diff --git a/Modules/Bar/Extras/BarPillHorizontal.qml b/Modules/Bar/Extras/BarPillHorizontal.qml index f58e26e2d..b7d871b20 100644 --- a/Modules/Bar/Extras/BarPillHorizontal.qml +++ b/Modules/Bar/Extras/BarPillHorizontal.qml @@ -132,6 +132,7 @@ Item { NIcon { icon: root.icon pointSize: iconSize + applyUiScale: false color: hovered ? Color.mOnTertiary : Color.mOnSurface // Center horizontally x: (iconCircle.width - width) / 2 diff --git a/Modules/Bar/Extras/BarPillVertical.qml b/Modules/Bar/Extras/BarPillVertical.qml index bba3457a9..781dc5877 100644 --- a/Modules/Bar/Extras/BarPillVertical.qml +++ b/Modules/Bar/Extras/BarPillVertical.qml @@ -155,6 +155,7 @@ Item { NIcon { icon: root.icon pointSize: iconSize + applyUiScale: false color: hovered ? Color.mOnTertiary : Color.mOnSurface // Center horizontally x: (iconCircle.width - width) / 2 diff --git a/Modules/Bar/Extras/TrayMenu.qml b/Modules/Bar/Extras/TrayMenu.qml index 968d91bc8..c0f15e0e7 100644 --- a/Modules/Bar/Extras/TrayMenu.qml +++ b/Modules/Bar/Extras/TrayMenu.qml @@ -165,6 +165,7 @@ PopupWindow { NIcon { icon: modelData?.hasChildren ? "menu" : "" pointSize: Style.fontSizeS + applyUiScale: false verticalAlignment: Text.AlignVCenter visible: modelData?.hasChildren ?? false color: (mouseArea.containsMouse ? Color.mOnTertiary : Color.mOnSurface) diff --git a/Modules/Bar/Widgets/Bluetooth.qml b/Modules/Bar/Widgets/Bluetooth.qml index ab42336b0..55346b899 100644 --- a/Modules/Bar/Widgets/Bluetooth.qml +++ b/Modules/Bar/Widgets/Bluetooth.qml @@ -13,6 +13,7 @@ NIconButton { property ShellScreen screen baseSize: Style.capsuleHeight + applyUiScale: false compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini") colorBg: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent colorFg: Color.mOnSurface diff --git a/Modules/Bar/Widgets/ControlCenter.qml b/Modules/Bar/Widgets/ControlCenter.qml index ec00736b2..ee7122b2a 100644 --- a/Modules/Bar/Widgets/ControlCenter.qml +++ b/Modules/Bar/Widgets/ControlCenter.qml @@ -37,6 +37,7 @@ NIconButton { tooltipText: I18n.tr("tooltips.open-control-center") tooltipDirection: BarService.getTooltipDirection() baseSize: Style.capsuleHeight + applyUiScale: false compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini") colorBg: (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) colorFg: Color.mOnSurface diff --git a/Modules/Bar/Widgets/DarkMode.qml b/Modules/Bar/Widgets/DarkMode.qml index 868715f39..3523eac68 100644 --- a/Modules/Bar/Widgets/DarkMode.qml +++ b/Modules/Bar/Widgets/DarkMode.qml @@ -13,6 +13,7 @@ NIconButton { tooltipDirection: BarService.getTooltipDirection() compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini") baseSize: Style.capsuleHeight + applyUiScale: false colorBg: Settings.data.colorSchemes.darkMode ? (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) : Color.mPrimary colorFg: Settings.data.colorSchemes.darkMode ? Color.mOnSurface : Color.mOnPrimary colorBorder: Color.transparent diff --git a/Modules/Bar/Widgets/KeepAwake.qml b/Modules/Bar/Widgets/KeepAwake.qml index d265668b2..4612360bf 100644 --- a/Modules/Bar/Widgets/KeepAwake.qml +++ b/Modules/Bar/Widgets/KeepAwake.qml @@ -11,6 +11,7 @@ NIconButton { property ShellScreen screen baseSize: Style.capsuleHeight + applyUiScale: false compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini") icon: IdleInhibitorService.isInhibited ? "keep-awake-on" : "keep-awake-off" tooltipText: IdleInhibitorService.isInhibited ? I18n.tr("tooltips.disable-keep-awake") : I18n.tr("tooltips.enable-keep-awake") diff --git a/Modules/Bar/Widgets/NightLight.qml b/Modules/Bar/Widgets/NightLight.qml index 758297cc4..1554c9363 100644 --- a/Modules/Bar/Widgets/NightLight.qml +++ b/Modules/Bar/Widgets/NightLight.qml @@ -15,6 +15,7 @@ NIconButton { compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini") baseSize: Style.capsuleHeight + applyUiScale: false colorBg: Settings.data.nightLight.forced ? Color.mPrimary : (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) colorFg: Settings.data.nightLight.forced ? Color.mOnPrimary : Color.mOnSurface colorBorder: Color.transparent diff --git a/Modules/Bar/Widgets/NotificationHistory.qml b/Modules/Bar/Widgets/NotificationHistory.qml index 8e02d57c0..3f0c3c00a 100644 --- a/Modules/Bar/Widgets/NotificationHistory.qml +++ b/Modules/Bar/Widgets/NotificationHistory.qml @@ -49,6 +49,7 @@ NIconButton { } baseSize: Style.capsuleHeight + applyUiScale: false compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini") icon: Settings.data.notifications.doNotDisturb ? "bell-off" : "bell" tooltipText: Settings.data.notifications.doNotDisturb ? I18n.tr("tooltips.open-notification-history-disable-dnd") : I18n.tr("tooltips.open-notification-history-enable-dnd") diff --git a/Modules/Bar/Widgets/PowerProfile.qml b/Modules/Bar/Widgets/PowerProfile.qml index 1cdd70e43..1d5276887 100644 --- a/Modules/Bar/Widgets/PowerProfile.qml +++ b/Modules/Bar/Widgets/PowerProfile.qml @@ -12,14 +12,14 @@ NIconButton { property ShellScreen screen baseSize: Style.capsuleHeight + applyUiScale: false + compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini") visible: PowerProfileService.available - icon: PowerProfileService.getIcon() tooltipText: I18n.tr("tooltips.power-profile", { "profile": PowerProfileService.getName() }) tooltipDirection: BarService.getTooltipDirection() - compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini") colorBg: (PowerProfileService.profile === PowerProfile.Balanced) ? (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) : Color.mPrimary colorFg: (PowerProfileService.profile === PowerProfile.Balanced) ? Color.mOnSurface : Color.mOnPrimary colorBorder: Color.transparent diff --git a/Modules/Bar/Widgets/ScreenRecorder.qml b/Modules/Bar/Widgets/ScreenRecorder.qml index 1796a96f3..59728c0c1 100644 --- a/Modules/Bar/Widgets/ScreenRecorder.qml +++ b/Modules/Bar/Widgets/ScreenRecorder.qml @@ -14,6 +14,7 @@ NIconButton { tooltipDirection: BarService.getTooltipDirection() compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini") baseSize: Style.capsuleHeight + applyUiScale: false colorBg: ScreenRecorderService.isRecording ? Color.mPrimary : (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) colorFg: ScreenRecorderService.isRecording ? Color.mOnPrimary : Color.mOnSurface colorBorder: Color.transparent diff --git a/Modules/Bar/Widgets/SessionMenu.qml b/Modules/Bar/Widgets/SessionMenu.qml index 7f693e12f..e5125615b 100644 --- a/Modules/Bar/Widgets/SessionMenu.qml +++ b/Modules/Bar/Widgets/SessionMenu.qml @@ -12,6 +12,7 @@ NIconButton { compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini") baseSize: Style.capsuleHeight + applyUiScale: false icon: "power" tooltipText: I18n.tr("tooltips.session-menu") tooltipDirection: BarService.getTooltipDirection() diff --git a/Modules/Bar/Widgets/WallpaperSelector.qml b/Modules/Bar/Widgets/WallpaperSelector.qml index 30c5c0bfe..c707b9426 100644 --- a/Modules/Bar/Widgets/WallpaperSelector.qml +++ b/Modules/Bar/Widgets/WallpaperSelector.qml @@ -11,6 +11,7 @@ NIconButton { property ShellScreen screen baseSize: Style.capsuleHeight + applyUiScale: false compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini") icon: "wallpaper-selector" tooltipText: I18n.tr("tooltips.open-wallpaper-selector") diff --git a/Modules/Bar/Widgets/WiFi.qml b/Modules/Bar/Widgets/WiFi.qml index 5197f017a..53c7686ce 100644 --- a/Modules/Bar/Widgets/WiFi.qml +++ b/Modules/Bar/Widgets/WiFi.qml @@ -14,6 +14,7 @@ NIconButton { compact: (Settings.data.bar.density === "compact") || (Settings.data.bar.density === "mini") baseSize: Style.capsuleHeight + applyUiScale: false colorBg: (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) colorFg: Color.mOnSurface colorBorder: Color.transparent diff --git a/Widgets/NIconButton.qml b/Widgets/NIconButton.qml index 1f09e1d53..5bfee0355 100644 --- a/Widgets/NIconButton.qml +++ b/Widgets/NIconButton.qml @@ -7,7 +7,8 @@ import qs.Services Rectangle { id: root - property real baseSize: Style.baseWidgetSize * Style.uiScaleRatio + property real baseSize: Style.baseWidgetSize + property bool applyUiScale: true property string icon property string tooltipText @@ -30,8 +31,8 @@ Rectangle { signal rightClicked signal middleClicked - implicitWidth: Math.round(baseSize) - implicitHeight: Math.round(baseSize) + implicitWidth: applyUiScale ? Math.round(baseSize * applyUiScale) : Math.round(baseSize) + implicitHeight: applyUiScale ? Math.round(baseSize * applyUiScale) : Math.round(baseSize) opacity: root.enabled ? Style.opacityFull : Style.opacityMedium color: root.enabled && root.hovering ? colorBgHover : colorBg @@ -49,6 +50,7 @@ Rectangle { NIcon { icon: root.icon pointSize: Math.max(1, root.compact ? root.width * 0.65 : root.width * 0.48) + applyUiScale: root.applyUiScale color: root.enabled && root.hovering ? colorFgHover : colorFg // Center horizontally x: (root.width - width) / 2