1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -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

@@ -14,6 +14,7 @@ Singleton {
property bool themeIsDynamic: false
property bool isLightMode: false
property real topBarTransparency: 0.75
property real topBarWidgetTransparency: 0.85
property real popupTransparency: 0.92
property var appUsageRanking: {}
property bool use24HourClock: true
@@ -58,6 +59,7 @@ Singleton {
themeIsDynamic = settings.themeIsDynamic !== undefined ? settings.themeIsDynamic : false;
isLightMode = settings.isLightMode !== undefined ? settings.isLightMode : false;
topBarTransparency = settings.topBarTransparency !== undefined ? (settings.topBarTransparency > 1 ? settings.topBarTransparency / 100 : settings.topBarTransparency) : 0.75;
topBarWidgetTransparency = settings.topBarWidgetTransparency !== undefined ? (settings.topBarWidgetTransparency > 1 ? settings.topBarWidgetTransparency / 100 : settings.topBarWidgetTransparency) : 0.85;
popupTransparency = settings.popupTransparency !== undefined ? (settings.popupTransparency > 1 ? settings.popupTransparency / 100 : settings.popupTransparency) : 0.92;
appUsageRanking = settings.appUsageRanking || {};
use24HourClock = settings.use24HourClock !== undefined ? settings.use24HourClock : true;
@@ -105,6 +107,7 @@ Singleton {
"themeIsDynamic": themeIsDynamic,
"isLightMode": isLightMode,
"topBarTransparency": topBarTransparency,
"topBarWidgetTransparency": topBarWidgetTransparency,
"popupTransparency": popupTransparency,
"appUsageRanking": appUsageRanking,
"use24HourClock": use24HourClock,
@@ -177,6 +180,11 @@ Singleton {
saveSettings();
}
function setTopBarWidgetTransparency(transparency) {
topBarWidgetTransparency = transparency;
saveSettings();
}
function setPopupTransparency(transparency) {
popupTransparency = transparency;
saveSettings();

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");