diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-19 10:01:49 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-19 10:01:49 +0200 |
| commit | d9c9c30865330b24349438e4e20579fd76dafbd5 (patch) | |
| tree | 6dd01b16f51a1bda83e0a2f066c3bbd9218a4f69 /desktop/modules/notifications | |
| parent | 26653d3cb8d2a9b19133a8c2bc981a669a3f81bd (diff) | |
| download | quickshell-d9c9c30865330b24349438e4e20579fd76dafbd5.tar.gz quickshell-d9c9c30865330b24349438e4e20579fd76dafbd5.zip | |
desktop: report save results in the SaveBar, not at the page's foot
A save's outcome sat at the bottom of the page, out of sight on a long
one, while "unsaved changes" was already in the header. SaveBar gains
notice, shown once the page is clean, and error, shown in red over the
unsaved mark, since a refused or failed write leaves the draft dirty.
Wired for notifications, HyprIdle, Sunset, Wallpaper and the four Mail
pages, with their longer messages shortened to fit the header. Messages
that are not save results stay in their pages: the icon theme's
immediate apply, Sunset's location detection, the assistant restart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/notifications')
| -rw-r--r-- | desktop/modules/notifications/NotificationsModule.qml | 14 | ||||
| -rw-r--r-- | desktop/modules/notifications/NotificationsPage.qml | 8 |
2 files changed, 9 insertions, 13 deletions
diff --git a/desktop/modules/notifications/NotificationsModule.qml b/desktop/modules/notifications/NotificationsModule.qml index 7a113df..df52949 100644 --- a/desktop/modules/notifications/NotificationsModule.qml +++ b/desktop/modules/notifications/NotificationsModule.qml @@ -27,6 +27,7 @@ Module { property var draft: Notify.config property string notice: "" + property string error: "" // The installed sound themes (directories with an index.theme), and the // system theme as gsettings has it, "" when unreadable. Both reread on // every refresh, so a change made outside the page shows. @@ -45,7 +46,7 @@ Module { nm.themeLister.running = false; nm.themeLister.running = true; nm.gsGet.running = false; nm.gsGet.running = true; } - function discard() { nm.follow(); nm.notice = ""; } + function discard() { nm.follow(); nm.notice = ""; nm.error = ""; } function edit(patch) { nm.draft = Object.assign({}, nm.draft, patch); } // Unknown keys in the file survive, including inside timeouts and @@ -56,6 +57,7 @@ Module { // the sequence notes' bodyWriter uses (NotesModule.qml). function save() { nm.notice = ""; + nm.error = ""; const raw = Notify.rawConfig; const obj = v => v && typeof v === "object" && !Array.isArray(v) ? v : {}; const out = Object.assign({}, raw, nm.draft, { @@ -82,10 +84,10 @@ Module { nm.saver.stdinEnabled = false; } onExited: code => { - nm.notice = code === 0 ? "saved" - : code === 2 ? "saved; notifyd not reachable, it reads the file at its next start" - : code === 3 ? "saved; the system sound theme could not be set" - : "could not write " + Notify.configPath; + if (code === 1) nm.error = "could not write config.json"; + else nm.notice = code === 0 ? "saved" + : code === 2 ? "saved; notifyd not running, it reads it at start" + : "saved; system sound theme not set"; nm.gsGet.running = false; nm.gsGet.running = true; } } @@ -110,6 +112,8 @@ Module { title: "Notifications" actions: Component { SaveBar { dirty: nm.dirty; valid: nm.valid; note: "caps are 1 to 100"; busy: nm.saver.running + notice: nm.notice; noticeColor: nm.notice === "saved" ? Theme.green : Theme.yellow + error: nm.error onSave: nm.save(); onDiscard: nm.discard() } } NotificationsPage { width: parent.width; mod: nm } diff --git a/desktop/modules/notifications/NotificationsPage.qml b/desktop/modules/notifications/NotificationsPage.qml index ce09a9d..612fb83 100644 --- a/desktop/modules/notifications/NotificationsPage.qml +++ b/desktop/modules/notifications/NotificationsPage.qml @@ -286,12 +286,4 @@ Column { value = ""; } } - - Text { - width: pg.width; wrapMode: Text.Wrap - visible: pg.mod.notice !== "" - text: pg.mod.notice - color: pg.mod.notice === "saved" ? Theme.green : Theme.yellow - font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 3 } - } } |
