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

Many bug fixes for media center, spotlight

This commit is contained in:
bbedward
2025-07-12 10:47:01 -04:00
parent 2375b6e7bd
commit af0522ada5
13 changed files with 180 additions and 329 deletions

View File

@@ -17,7 +17,7 @@ Singleton {
Component.onCompleted: {
loadSettings()
Qt.callLater(applyStoredTheme)
// Theme will be applied after settings file is loaded in onLoaded handler
}
Process {
@@ -64,16 +64,22 @@ Singleton {
(settings.topBarTransparency > 1 ? settings.topBarTransparency / 100.0 : settings.topBarTransparency) : 0.75
recentlyUsedApps = settings.recentlyUsedApps || []
console.log("Loaded settings - themeIndex:", themeIndex, "isDynamic:", themeIsDynamic, "lightMode:", isLightMode, "transparency:", topBarTransparency, "recentApps:", recentlyUsedApps.length)
// Apply the theme immediately after loading settings
applyStoredTheme()
} else {
console.log("Settings file is empty")
console.log("Settings file is empty - applying default theme")
applyStoredTheme()
}
} catch (e) {
console.log("Could not parse settings, using defaults:", e)
applyStoredTheme()
}
}
onLoadFailed: (error) => {
console.log("Settings file not found, using defaults. Error:", error)
applyStoredTheme()
}
}
@@ -99,13 +105,15 @@ Singleton {
}
function applyStoredTheme() {
console.log("Applying stored theme:", themeIndex, themeIsDynamic)
console.log("Applying stored theme:", themeIndex, themeIsDynamic, "lightMode:", isLightMode)
if (typeof Theme !== "undefined") {
Theme.isLightMode = isLightMode
Theme.switchTheme(themeIndex, themeIsDynamic, false)
} else {
Qt.callLater(() => {
if (typeof Theme !== "undefined") {
Theme.isLightMode = isLightMode
Theme.switchTheme(themeIndex, themeIsDynamic, false)
}
})

View File

@@ -10,7 +10,7 @@ QtObject {
// Reference to the main shell root for calling functions
property var rootObj: null
// Apply saved theme on startup
// Initialize theme system
Component.onCompleted: {
console.log("Theme Component.onCompleted")
@@ -19,13 +19,7 @@ QtObject {
Colors.colorsUpdated.connect(root.onColorsUpdated)
}
Qt.callLater(() => {
if (typeof Prefs !== "undefined") {
console.log("Theme applying saved preferences:", Prefs.themeIndex, Prefs.themeIsDynamic, "lightMode:", Prefs.isLightMode)
isLightMode = Prefs.isLightMode
switchTheme(Prefs.themeIndex, Prefs.themeIsDynamic, false) // Don't save during startup
}
})
console.log("Theme initialized, waiting for Prefs to load settings and apply theme")
}
// Handle successful color extraction