mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
feat(perf): enforce 100% opacity in noctalia performance mode
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user