diff options
Diffstat (limited to 'desktop/Prefs.qml')
| -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 0ed6ee9..6340b91 100644 --- a/desktop/Prefs.qml +++ b/desktop/Prefs.qml @@ -45,6 +45,17 @@ Singleton { root.write(Object.assign({}, root.doc, { assistant: a })); } + // Whether the desktop companion is shown: SUPER+\ and the Companion + // settings page both set it, so it survives a restart. ready is false + // until the file has been read, so she does not show and then vanish. + property bool companion: true + property bool ready: false + function setCompanion(on) { + if (on === root.companion) return; + root.companion = on; + root.write(Object.assign({}, root.doc, { companion: on })); + } + // The settings window's sidebar width, dragged by its edge. readonly property int sidebarMin: 160 readonly property int sidebarMax: 420 @@ -103,6 +114,8 @@ Singleton { const w = parsed.settings ? parsed.settings.sidebar : undefined; root.settingsSidebar = typeof w === "number" && w >= root.sidebarMin && w <= root.sidebarMax ? Math.round(w) : 200; + root.companion = parsed.companion !== false; + root.ready = true; } FileView { @@ -117,6 +130,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 = ""; } + onLoadFailed: { root.doc = {}; root.pinnedIp = ""; root.presets = null; root.settingsSidebar = 200; root.assistantModel = ""; root.companion = true; root.ready = true; } } } |
