From 25e819618291e09b379c4b29dfc0ff5aeeae1c09 Mon Sep 17 00:00:00 2001 From: notiant <238434866+notiant@users.noreply.github.com> Date: Tue, 10 Mar 2026 21:37:55 +0100 Subject: [PATCH] apply reduced light mode opacity to panel backgrounds --- Commons/Color.qml | 8 ++++++-- Modules/MainScreen/Backgrounds/AllBackgrounds.qml | 4 ++-- Modules/Panels/Launcher/LauncherOverlayWindow.qml | 2 +- Modules/Panels/Network/WiFiNetworksList.qml | 2 +- .../Panels/Settings/Tabs/Connections/BluetoothSubTab.qml | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Commons/Color.qml b/Commons/Color.qml index 680600424..8c5c3610f 100644 --- a/Commons/Color.qml +++ b/Commons/Color.qml @@ -329,8 +329,7 @@ Singleton { if (!Settings.data.ui.translucentWidgets) return baseColor; - let baseOpacity = Settings.data.ui.panelBackgroundOpacity; - let targetOpacity = Settings.data.colorSchemes.darkMode ? baseOpacity : Math.pow(baseOpacity, 2); + let targetOpacity = root.panelBackgroundOpacity let alpha = Math.max(targetOpacity, minAlpha); // Combine with the base color's existing alpha @@ -338,6 +337,11 @@ Singleton { return Qt.alpha(baseColor, resultAlpha); } + readonly property real panelBackgroundOpacity: { + let baseOpacity = Settings.data.ui.panelBackgroundOpacity; + return Settings.data.colorSchemes.darkMode ? baseOpacity : Math.pow(baseOpacity, 2); + } + readonly property var colorKeyModel: [ { "key": "none", diff --git a/Modules/MainScreen/Backgrounds/AllBackgrounds.qml b/Modules/MainScreen/Backgrounds/AllBackgrounds.qml index 16b9dcf9f..9665b1860 100644 --- a/Modules/MainScreen/Backgrounds/AllBackgrounds.qml +++ b/Modules/MainScreen/Backgrounds/AllBackgrounds.qml @@ -38,7 +38,7 @@ Item { // Enable layer caching to prevent continuous re-rendering layer.enabled: true - opacity: Settings.data.ui.panelBackgroundOpacity + opacity: Color.panelBackgroundOpacity Shape { id: unifiedBackgroundsShape @@ -106,7 +106,7 @@ Item { anchors.fill: parent layer.enabled: true - opacity: Settings.data.ui.panelBackgroundOpacity + opacity: Color.panelBackgroundOpacity Shape { id: panelBackgroundsShape diff --git a/Modules/Panels/Launcher/LauncherOverlayWindow.qml b/Modules/Panels/Launcher/LauncherOverlayWindow.qml index 6bca83de2..243d5d4ee 100644 --- a/Modules/Panels/Launcher/LauncherOverlayWindow.qml +++ b/Modules/Panels/Launcher/LauncherOverlayWindow.qml @@ -255,7 +255,7 @@ Variants { ShapePath { strokeWidth: -1 - fillColor: Qt.alpha(Color.mSurfaceVariant, Settings.data.ui.panelBackgroundOpacity) + fillColor: Qt.alpha(Color.mSurfaceVariant, Color.panelBackgroundOpacity) // Offset by radius to account for Shape's extended bounds startX: panelShape.radius + panelShape.radius * panelShape.tlMultX diff --git a/Modules/Panels/Network/WiFiNetworksList.qml b/Modules/Panels/Network/WiFiNetworksList.qml index 90ce33e88..2a56cdc37 100644 --- a/Modules/Panels/Network/WiFiNetworksList.qml +++ b/Modules/Panels/Network/WiFiNetworksList.qml @@ -82,7 +82,7 @@ NBox { opacity: (NetworkService.disconnectingFrom === modelData.ssid || NetworkService.forgettingNetwork === modelData.ssid) ? 0.6 : 1.0 - color: modelData.connected ? Qt.alpha(Color.mPrimary, Math.min(1.15 - Settings.data.ui.panelBackgroundOpacity, 0.75)) : Color.mSurface + color: modelData.connected ? Qt.alpha(Color.mPrimary, Math.min(1.15 - Color.panelBackgroundOpacity, 0.75)) : Color.mSurface Behavior on opacity { NumberAnimation { diff --git a/Modules/Panels/Settings/Tabs/Connections/BluetoothSubTab.qml b/Modules/Panels/Settings/Tabs/Connections/BluetoothSubTab.qml index fa8318882..7db8d6319 100644 --- a/Modules/Panels/Settings/Tabs/Connections/BluetoothSubTab.qml +++ b/Modules/Panels/Settings/Tabs/Connections/BluetoothSubTab.qml @@ -389,7 +389,7 @@ Item { radius: Style.radiusM clip: true - color: (modelData.connected && modelData.state !== BluetoothDeviceState.Disconnecting) ? Qt.alpha(Color.mPrimary, Math.min(1.15 - Settings.data.ui.panelBackgroundOpacity, 0.75)) : Color.mSurface + color: (modelData.connected && modelData.state !== BluetoothDeviceState.Disconnecting) ? Qt.alpha(Color.mPrimary, Math.min(1.15 - Color.panelBackgroundOpacity, 0.75)) : Color.mSurface ColumnLayout { id: deviceColumn