diff options
Diffstat (limited to 'desktop/companion/Companion.qml')
| -rw-r--r-- | desktop/companion/Companion.qml | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/desktop/companion/Companion.qml b/desktop/companion/Companion.qml index e6d21e2..12dd009 100644 --- a/desktop/companion/Companion.qml +++ b/desktop/companion/Companion.qml @@ -30,8 +30,18 @@ PanelWindow { readonly property string art: Quickshell.env("HOME") + "/.local/share/keystone/companion/2b/frames" - // SUPER+\, through the IPC below. - property bool present: true + // SUPER+\ (the IPC below) and the Companion settings page, through Prefs, + // so it survives a restart. + readonly property bool present: Prefs.ready && Prefs.companion + onPresentChanged: { + if (root.present) { + root.destructAt = 0; // the skirt is back + root.now = Date.now(); + greet.restart(); + } else { + root.stopMonologue(); + } + } // The monitor she is on trails the focused one: a change plays her exit // here first, and only then moves the window (settled, below). @@ -298,20 +308,8 @@ PanelWindow { // --- showing and hiding ---------------------------------------------- - function appear() { - if (root.present) return; - root.present = true; - root.destructAt = 0; // the skirt is back - root.now = Date.now(); - greet.restart(); - } - function dismiss() { - if (!root.present) return; - root.stopMonologue(); - bubble.hide(); - root.present = false; - } - // After the drop-in has landed. + // After the drop-in has landed, on every appearance, the one at login + // included. Timer { id: greet interval: 450 @@ -324,9 +322,9 @@ PanelWindow { // qs -p <desktop> ipc call companion toggle -> SUPER+\ IpcHandler { target: "companion" - function toggle() { if (root.present) root.dismiss(); else root.appear(); } - function show() { root.appear(); } - function hide() { root.dismiss(); } + function toggle() { Prefs.setCompanion(!Prefs.companion); } + function show() { Prefs.setCompanion(true); } + function hide() { Prefs.setCompanion(false); } } // The exit has played on the old monitor: move, and the entrance plays. |
