diff options
| -rw-r--r-- | desktop/Prefs.qml | 15 |
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; } } } |
