From d9c9c30865330b24349438e4e20579fd76dafbd5 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 19 Oct 2026 10:01:49 +0200 Subject: 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 --- desktop/modules/appearance/Hyprsunset.qml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'desktop/modules/appearance/Hyprsunset.qml') diff --git a/desktop/modules/appearance/Hyprsunset.qml b/desktop/modules/appearance/Hyprsunset.qml index 4befcb5..daf07b0 100644 --- a/desktop/modules/appearance/Hyprsunset.qml +++ b/desktop/modules/appearance/Hyprsunset.qml @@ -35,6 +35,9 @@ Singleton { property string cachePathRaw: "~/.config/hyprsunset-qt/sun.json" property string cachePath: `${home}/.config/hyprsunset-qt/sun.json` property string notice: "" + // The last save's outcome, for the SaveBar: notice is location detection. + property string saveNotice: "" + property string saveError: "" property string sunSummary: "" property bool busy: false property bool confLoaded: false @@ -160,6 +163,7 @@ profile { } function refresh() { + root.saveError = ""; confProc.running = false; confProc.running = true; appProc.running = false; @@ -241,13 +245,13 @@ profile { function save() { if (!root.confLoaded || !root.appLoaded) return; for (const p of root.profiles) { - if (!root.validTime(p.time)) { root.notice = `invalid time: ${p.time}`; return; } + if (!root.validTime(p.time)) { root.saveError = `invalid time: ${p.time}`; return; } if (p.temperature !== null && p.temperature !== undefined && !root.validTemperature(p.temperature)) { - root.notice = `invalid temperature: ${p.temperature}`; return; + root.saveError = `invalid temperature: ${p.temperature}`; return; } if (p.gamma !== null && p.gamma !== undefined && !root.validGamma(p.gamma)) { - root.notice = `invalid gamma: ${p.gamma}`; return; + root.saveError = `invalid gamma: ${p.gamma}`; return; } } root.savedConf = root.serializeProfiles(root.profiles); @@ -255,7 +259,8 @@ profile { confFile.setText(root.savedConf); root.saveSettings(); root.restart(); - root.notice = "saved + restarted"; + root.saveError = ""; + root.saveNotice = "saved + restarted"; } // Live preview via the daemon's IPC. Identity wins, then temperature, then -- cgit v1.2.3