feat(perf): enforce 100% opacity in noctalia performance mode

This commit is contained in:
Lysec
2026-04-10 13:41:18 +02:00
parent e85ce902cb
commit 5f45191d7f
3 changed files with 12 additions and 3 deletions
+6
View File
@@ -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;
+3
View File
@@ -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
@@ -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