From 3a6bf8d299420d7c0a20c011d00d427e2f22e6b6 Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Tue, 16 Sep 2025 22:20:42 -0400 Subject: [PATCH] Bar widgets: fixed bg colors when used with showCapsule=false --- Modules/Bar/Widgets/Bluetooth.qml | 2 +- Modules/Bar/Widgets/DarkModeToggle.qml | 4 +++- Modules/Bar/Widgets/KeepAwake.qml | 2 +- Modules/Bar/Widgets/NightLight.qml | 2 +- Modules/Bar/Widgets/NotificationHistory.qml | 2 +- Modules/Bar/Widgets/PowerProfile.qml | 2 +- Modules/Bar/Widgets/PowerToggle.qml | 2 +- Modules/Bar/Widgets/SidePanelToggle.qml | 2 +- Modules/Bar/Widgets/WiFi.qml | 2 +- Widgets/NIconButton.qml | 2 +- 10 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Modules/Bar/Widgets/Bluetooth.qml b/Modules/Bar/Widgets/Bluetooth.qml index 40ed96a..656794b 100644 --- a/Modules/Bar/Widgets/Bluetooth.qml +++ b/Modules/Bar/Widgets/Bluetooth.qml @@ -15,7 +15,7 @@ NIconButton { baseSize: Style.capsuleHeight compact: (Settings.data.bar.density === "compact") - colorBg: Color.mSurfaceVariant + colorBg: Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent colorFg: Color.mOnSurface colorBorder: Color.transparent colorBorderHover: Color.transparent diff --git a/Modules/Bar/Widgets/DarkModeToggle.qml b/Modules/Bar/Widgets/DarkModeToggle.qml index 8e39204..0e45bd2 100644 --- a/Modules/Bar/Widgets/DarkModeToggle.qml +++ b/Modules/Bar/Widgets/DarkModeToggle.qml @@ -13,9 +13,11 @@ NIconButton { tooltipText: "Toggle light/dark mode." compact: (Settings.data.bar.density === "compact") baseSize: Style.capsuleHeight - colorBg: Settings.data.colorSchemes.darkMode ? Color.mSurfaceVariant : Color.mPrimary + 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 colorBorderHover: Color.transparent onClicked: Settings.data.colorSchemes.darkMode = !Settings.data.colorSchemes.darkMode } + + diff --git a/Modules/Bar/Widgets/KeepAwake.qml b/Modules/Bar/Widgets/KeepAwake.qml index eb0cf13..9c4626f 100644 --- a/Modules/Bar/Widgets/KeepAwake.qml +++ b/Modules/Bar/Widgets/KeepAwake.qml @@ -15,7 +15,7 @@ NIconButton { compact: (Settings.data.bar.density === "compact") icon: IdleInhibitorService.isInhibited ? "keep-awake-on" : "keep-awake-off" tooltipText: IdleInhibitorService.isInhibited ? "Disable keep awake" : "Enable keep awake" - colorBg: IdleInhibitorService.isInhibited ? Color.mPrimary : Color.mSurfaceVariant + colorBg: IdleInhibitorService.isInhibited ? Color.mPrimary : (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) colorFg: IdleInhibitorService.isInhibited ? Color.mOnPrimary : Color.mOnSurface colorBorder: Color.transparent onClicked: IdleInhibitorService.manualToggle() diff --git a/Modules/Bar/Widgets/NightLight.qml b/Modules/Bar/Widgets/NightLight.qml index 9d40eb0..d48097c 100644 --- a/Modules/Bar/Widgets/NightLight.qml +++ b/Modules/Bar/Widgets/NightLight.qml @@ -16,7 +16,7 @@ NIconButton { compact: (Settings.data.bar.density === "compact") baseSize: Style.capsuleHeight - colorBg: Settings.data.nightLight.forced ? Color.mPrimary : Color.mSurfaceVariant + 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 colorBorderHover: Color.transparent diff --git a/Modules/Bar/Widgets/NotificationHistory.qml b/Modules/Bar/Widgets/NotificationHistory.qml index 2446312..91faa68 100644 --- a/Modules/Bar/Widgets/NotificationHistory.qml +++ b/Modules/Bar/Widgets/NotificationHistory.qml @@ -53,7 +53,7 @@ NIconButton { compact: (Settings.data.bar.density === "compact") icon: Settings.data.notifications.doNotDisturb ? "bell-off" : "bell" tooltipText: Settings.data.notifications.doNotDisturb ? "Notification history.\nRight-click to disable 'Do Not Disturb'." : "Notification history.\nRight-click to enable 'Do Not Disturb'." - colorBg: Color.mSurfaceVariant + colorBg: (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) colorFg: Color.mOnSurface colorBorder: Color.transparent colorBorderHover: Color.transparent diff --git a/Modules/Bar/Widgets/PowerProfile.qml b/Modules/Bar/Widgets/PowerProfile.qml index 1aba22a..2ddda3f 100644 --- a/Modules/Bar/Widgets/PowerProfile.qml +++ b/Modules/Bar/Widgets/PowerProfile.qml @@ -47,7 +47,7 @@ NIconButton { icon: root.profileIcon() tooltipText: root.profileName() compact: (Settings.data.bar.density === "compact") - colorBg: (PowerProfileService.profile === PowerProfile.Balanced) ? Color.mSurfaceVariant : Color.mPrimary + 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 colorBorderHover: Color.transparent diff --git a/Modules/Bar/Widgets/PowerToggle.qml b/Modules/Bar/Widgets/PowerToggle.qml index bd6eceb..9f33274 100644 --- a/Modules/Bar/Widgets/PowerToggle.qml +++ b/Modules/Bar/Widgets/PowerToggle.qml @@ -15,7 +15,7 @@ NIconButton { baseSize: Style.capsuleHeight icon: "power" tooltipText: "Power Settings" - colorBg: Color.mSurfaceVariant + colorBg: (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) colorFg: Color.mError colorBorder: Color.transparent colorBorderHover: Color.transparent diff --git a/Modules/Bar/Widgets/SidePanelToggle.qml b/Modules/Bar/Widgets/SidePanelToggle.qml index 4c122d1..b52e41f 100644 --- a/Modules/Bar/Widgets/SidePanelToggle.qml +++ b/Modules/Bar/Widgets/SidePanelToggle.qml @@ -35,7 +35,7 @@ NIconButton { tooltipText: "Open side panel." baseSize: Style.capsuleHeight compact: (Settings.data.bar.density === "compact") - colorBg: Color.mSurfaceVariant + colorBg: (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) colorFg: Color.mOnSurface colorBgHover: useDistroLogo ? Color.mSurfaceVariant : Color.mTertiary colorBorder: Color.transparent diff --git a/Modules/Bar/Widgets/WiFi.qml b/Modules/Bar/Widgets/WiFi.qml index fb64f68..9bc6058 100644 --- a/Modules/Bar/Widgets/WiFi.qml +++ b/Modules/Bar/Widgets/WiFi.qml @@ -15,7 +15,7 @@ NIconButton { compact: (Settings.data.bar.density === "compact") baseSize: Style.capsuleHeight - colorBg: Color.mSurfaceVariant + colorBg: (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) colorFg: Color.mOnSurface colorBorder: Color.transparent colorBorderHover: Color.transparent diff --git a/Widgets/NIconButton.qml b/Widgets/NIconButton.qml index ce5cc26..5989190 100644 --- a/Widgets/NIconButton.qml +++ b/Widgets/NIconButton.qml @@ -33,7 +33,7 @@ Rectangle { implicitHeight: Math.round(baseSize * scaling) opacity: root.enabled ? Style.opacityFull : Style.opacityMedium - color: root.enabled && root.hovering ? colorBgHover : Settings.data.bar.showCapsule ? colorBg : Color.transparent + color: root.enabled && root.hovering ? colorBgHover : colorBg radius: width * 0.5 border.color: root.enabled && root.hovering ? colorBorderHover : colorBorder border.width: Math.max(1, Style.borderS * scaling)