From f2252bf6987dbb0e06f46cf44e1ad2076fc8b475 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 6 Nov 2026 17:42:26 +0100 Subject: 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 --- desktop/Prefs.qml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'desktop/Prefs.qml') 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; } } } -- cgit v1.2.3