diff --git a/Commons/Color.qml b/Commons/Color.qml index ada4c63a5..3be7cbc31 100644 --- a/Commons/Color.qml +++ b/Commons/Color.qml @@ -4,6 +4,7 @@ import QtQuick import Quickshell import Quickshell.Io import qs.Commons +import qs.Services.Power /* Noctalia is not strictly a Material Design project, it supports both some predefined @@ -348,10 +349,15 @@ Singleton { // Adaptive opacity calculation: automatically makes light mode more transparent function adaptiveOpacity(baseOpacity) { + if (PowerProfileService.noctaliaPerformanceMode) + return 1.0; return Settings.data.colorSchemes.darkMode ? baseOpacity : Math.pow(baseOpacity, 1.5); } function smartAlpha(baseColor, minAlpha = 0.4) { + if (PowerProfileService.noctaliaPerformanceMode) + return baseColor; + if (!Settings.data.ui.translucentWidgets) return baseColor; diff --git a/Commons/Style.qml b/Commons/Style.qml index 1910401cd..d8182ceac 100644 --- a/Commons/Style.qml +++ b/Commons/Style.qml @@ -72,6 +72,9 @@ Singleton { readonly property real opacityAlmost: 0.95 readonly property real opacityFull: 1.0 + readonly property real effectivePanelOpacity: PowerProfileService.noctaliaPerformanceMode ? 1.0 : Color.adaptiveOpacity(Settings.data.ui.panelBackgroundOpacity) + readonly property real effectiveBarOpacity: PowerProfileService.noctaliaPerformanceMode ? 1.0 : Settings.data.bar.backgroundOpacity + // Shadows readonly property real shadowOpacity: 0.85 readonly property real shadowBlur: 1.0 diff --git a/Modules/MainScreen/Backgrounds/AllBackgrounds.qml b/Modules/MainScreen/Backgrounds/AllBackgrounds.qml index 4041bf8ae..a0000a547 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: Color.adaptiveOpacity(Settings.data.ui.panelBackgroundOpacity) + opacity: Style.effectivePanelOpacity Shape { id: unifiedBackgroundsShape @@ -106,7 +106,7 @@ Item { anchors.fill: parent layer.enabled: true - opacity: Color.adaptiveOpacity(Settings.data.ui.panelBackgroundOpacity) + opacity: Style.effectivePanelOpacity Shape { id: panelBackgroundsShape @@ -155,7 +155,7 @@ Item { anchors.fill: parent layer.enabled: true - opacity: Settings.data.bar.backgroundOpacity + opacity: Style.effectiveBarOpacity Shape { id: barBackgroundShape