mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
apply reduced light mode opacity also to dock, notifications & OSD
This commit is contained in:
+6
-7
@@ -324,23 +324,22 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
// Smart alpha calculation: automatically makes light mode more transparent
|
||||
// Adaptive opacity calculation: automatically makes light mode more transparent
|
||||
function adaptiveOpacity(baseOpacity) {
|
||||
return Settings.data.colorSchemes.darkMode ? baseOpacity : Math.pow(baseOpacity, 1.5);
|
||||
}
|
||||
|
||||
function smartAlpha(baseColor, minAlpha = 0.4) {
|
||||
if (!Settings.data.ui.translucentWidgets)
|
||||
return baseColor;
|
||||
|
||||
let alpha = Math.max(root.panelBackgroundOpacity, minAlpha);
|
||||
let alpha = Math.max(adaptiveOpacity(Settings.data.ui.panelBackgroundOpacity), minAlpha);
|
||||
|
||||
// Combine with the base color's existing alpha
|
||||
let resultAlpha = Math.max(0, baseColor.a - (1.0 - alpha));
|
||||
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",
|
||||
|
||||
Reference in New Issue
Block a user