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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user