1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-07 05:55:37 -05:00

Implement transparency background slider

This commit is contained in:
purian23
2025-07-12 04:07:25 -04:00
parent 959c8544bd
commit 2375b6e7bd
3 changed files with 77 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ Singleton {
property int themeIndex: 0
property bool themeIsDynamic: false
property bool isLightMode: false
property real topBarTransparency: 0.75
property var recentlyUsedApps: []
readonly property string configDir: Qt.resolvedUrl("file://" + Quickshell.env("HOME") + "/.config/DankMaterialDark")
@@ -59,8 +60,10 @@ Singleton {
themeIndex = settings.themeIndex !== undefined ? settings.themeIndex : 0
themeIsDynamic = settings.themeIsDynamic !== undefined ? settings.themeIsDynamic : false
isLightMode = settings.isLightMode !== undefined ? settings.isLightMode : false
topBarTransparency = settings.topBarTransparency !== undefined ?
(settings.topBarTransparency > 1 ? settings.topBarTransparency / 100.0 : settings.topBarTransparency) : 0.75
recentlyUsedApps = settings.recentlyUsedApps || []
console.log("Loaded settings - themeIndex:", themeIndex, "isDynamic:", themeIsDynamic, "lightMode:", isLightMode, "recentApps:", recentlyUsedApps.length)
console.log("Loaded settings - themeIndex:", themeIndex, "isDynamic:", themeIsDynamic, "lightMode:", isLightMode, "transparency:", topBarTransparency, "recentApps:", recentlyUsedApps.length)
} else {
console.log("Settings file is empty")
}
@@ -84,6 +87,7 @@ Singleton {
themeIndex: themeIndex,
themeIsDynamic: themeIsDynamic,
isLightMode: isLightMode,
topBarTransparency: topBarTransparency,
recentlyUsedApps: recentlyUsedApps
}
@@ -91,7 +95,7 @@ Singleton {
writeProcess.command = ["sh", "-c", "echo '" + content + "' > '" + Quickshell.env("HOME") + "/.config/DankMaterialDark/settings.json'"]
writeProcess.running = true
console.log("Saving settings - themeIndex:", themeIndex, "isDynamic:", themeIsDynamic, "lightMode:", isLightMode, "recentApps:", recentlyUsedApps.length)
console.log("Saving settings - themeIndex:", themeIndex, "isDynamic:", themeIsDynamic, "lightMode:", isLightMode, "transparency:", topBarTransparency, "recentApps:", recentlyUsedApps.length)
}
function applyStoredTheme() {
@@ -121,6 +125,12 @@ Singleton {
saveSettings()
}
function setTopBarTransparency(transparency) {
console.log("Prefs setTopBarTransparency called - topBarTransparency:", transparency)
topBarTransparency = transparency
saveSettings()
}
function addRecentApp(app) {
var existingIndex = -1
for (var i = 0; i < recentlyUsedApps.length; i++) {