1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-28 15:32:50 -05:00

Feature: Add topbar widget transparency appearance settings

This commit is contained in:
purian23
2025-07-27 00:02:47 -04:00
parent ec69c64b1a
commit 43f7ae89cc
16 changed files with 105 additions and 13 deletions

View File

@@ -431,6 +431,7 @@ Singleton {
property real opacityFull: 1
// Transparency system - can be overridden by Prefs
property real panelTransparency: 0.85
property real widgetTransparency: 0.85
property real popupTransparency: 0.92
// Handle successful color extraction
@@ -518,6 +519,10 @@ Singleton {
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, panelTransparency);
}
function widgetBackground() {
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, widgetTransparency);
}
function getBatteryIcon(level, isCharging, batteryAvailable) {
if (!batteryAvailable)
return _getBatteryPowerProfileIcon();
@@ -633,6 +638,9 @@ Singleton {
if (typeof Prefs !== "undefined") {
if (Prefs.popupTransparency !== undefined)
root.popupTransparency = Prefs.popupTransparency;
if (Prefs.topBarWidgetTransparency !== undefined)
root.widgetTransparency = Prefs.topBarWidgetTransparency;
// Connect to transparency changes
if (Prefs.popupTransparencyChanged)
@@ -641,6 +649,13 @@ Singleton {
root.popupTransparency = Prefs.popupTransparency;
});
if (Prefs.topBarWidgetTransparencyChanged)
Prefs.topBarWidgetTransparencyChanged.connect(function() {
if (typeof Prefs !== "undefined" && Prefs.topBarWidgetTransparency !== undefined)
root.widgetTransparency = Prefs.topBarWidgetTransparency;
});
}
console.log("Theme initialized, waiting for Prefs to load settings and apply theme");