Faster and smoother theme changes

This commit is contained in:
David Heinemeier Hansson
2026-05-17 17:03:28 +02:00
parent 4e50960c54
commit 8ad2f75758
4 changed files with 120 additions and 30 deletions
@@ -170,7 +170,18 @@ QtObject {
shellValues = parsed
}
property bool themeReloadSuspended: false
function suspendThemeReloads() {
themeReloadSuspended = true
}
function resumeThemeReloads() {
themeReloadSuspended = false
}
function reloadTheme() {
if (themeReloadSuspended) return
colorsFile.reload()
shellFile.reload()
}
@@ -184,7 +195,7 @@ QtObject {
watchChanges: true
printErrors: false
onLoaded: root.loadColors(text())
onFileChanged: reload()
onFileChanged: root.reloadTheme()
}
property FileView shellFile: FileView {
id: shellFile
@@ -193,7 +204,7 @@ QtObject {
printErrors: false
onLoaded: root.loadShell(text())
onLoadFailed: root.loadShell("")
onFileChanged: reload()
onFileChanged: root.reloadTheme()
}
property FileView themeNameFile: FileView {
path: Quickshell.env("HOME") + "/.config/omarchy/current/theme.name"