aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/Prefs.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-06 17:42:26 +0100
committerDanilo M. <danix@danix.xyz>2026-11-06 17:42:26 +0100
commitf2252bf6987dbb0e06f46cf44e1ad2076fc8b475 (patch)
tree04dd87add62d75f325367b8324b23e3f67abc4fe /desktop/Prefs.qml
parent187682aa4bd212632204d23706c5cb317028b5d3 (diff)
downloadquickshell-f2252bf6987dbb0e06f46cf44e1ad2076fc8b475.tar.gz
quickshell-f2252bf6987dbb0e06f46cf44e1ad2076fc8b475.zip
prefs: keep the wallpaper transition
Reassigned only on a real change: every page's save rereads the file, and a new object would reset the transitions page's unsaved draft. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/Prefs.qml')
-rw-r--r--desktop/Prefs.qml15
1 files changed, 14 insertions, 1 deletions
diff --git a/desktop/Prefs.qml b/desktop/Prefs.qml
index 8634f87..c238990 100644
--- a/desktop/Prefs.qml
+++ b/desktop/Prefs.qml
@@ -63,6 +63,15 @@ Singleton {
root.write(Object.assign({}, root.doc, { wallEngine: w }));
}
+ // The wallpaper transition as saved, or null for the defaults
+ // (modules/appearance/TransitionPick.js, which also validates what is
+ // read here).
+ property var wallTransition: null
+ function setWallTransition(t) {
+ root.wallTransition = t;
+ root.write(Object.assign({}, root.doc, { wallTransition: t }));
+ }
+
// The whole parsed object, so a write keeps keys this version does not
// know about.
property var doc: ({})
@@ -126,6 +135,10 @@ Singleton {
folderH: str(we.folderH), folderV: str(we.folderV),
homeH: str(we.homeH), homeV: str(we.homeV),
};
+ // Only on a real change: any page's save rereads this file, and a new
+ // object here would throw away the transitions page's draft.
+ const wt = parsed.wallTransition !== undefined ? parsed.wallTransition : null;
+ if (JSON.stringify(wt) !== JSON.stringify(root.wallTransition)) root.wallTransition = wt;
}
FileView {
@@ -140,6 +153,6 @@ Singleton {
onFileChanged: reload()
onLoaded: root.reparse()
// Missing file: the defaults, and nothing written.
- onLoadFailed: { root.doc = {}; root.pinnedIp = ""; root.presets = null; root.settingsSidebar = 200; root.assistantModel = ""; root.wallEngine = root.wallEngineDefaults; }
+ onLoadFailed: { root.doc = {}; root.pinnedIp = ""; root.presets = null; root.settingsSidebar = 200; root.assistantModel = ""; root.wallEngine = root.wallEngineDefaults; root.wallTransition = null; }
}
}