aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/SaveBar.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-19 10:01:49 +0200
committerDanilo M. <danix@danix.xyz>2026-10-19 10:01:49 +0200
commitd9c9c30865330b24349438e4e20579fd76dafbd5 (patch)
tree6dd01b16f51a1bda83e0a2f066c3bbd9218a4f69 /desktop/SaveBar.qml
parent26653d3cb8d2a9b19133a8c2bc981a669a3f81bd (diff)
downloadquickshell-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/SaveBar.qml')
-rw-r--r--desktop/SaveBar.qml21
1 files changed, 18 insertions, 3 deletions
diff --git a/desktop/SaveBar.qml b/desktop/SaveBar.qml
index fa55a15..147d00b 100644
--- a/desktop/SaveBar.qml
+++ b/desktop/SaveBar.qml
@@ -17,11 +17,19 @@ import QtQuick
// says what is wrong when Save is held back; the labels follow what the page
// does (Apply and Reset for a staged wallpaper or cursor, Save + Restart for
// a daemon that rereads only at start); busy shows while a save runs.
+//
+// The outcome of a save is reported here too, not at the foot of the page:
+// notice is what a finished save says ("saved"), shown once the page is
+// clean, in noticeColor; error is a save refused or failed, which leaves the
+// draft dirty, so it is shown over "unsaved changes", in red.
Row {
id: bar
property bool dirty: false
property bool valid: true
property string note: ""
+ property string notice: ""
+ property color noticeColor: Theme.green
+ property string error: ""
property string saveText: "Save"
property string discardText: "Discard"
property bool busy: false
@@ -31,9 +39,16 @@ Row {
Text {
anchors.verticalCenter: parent.verticalCenter
- visible: bar.dirty
- text: !bar.valid ? (bar.note || "fix the fields marked red") : "unsaved changes"
- color: bar.valid ? Theme.yellow : Theme.red
+ visible: bar.error !== "" || bar.dirty || bar.notice !== ""
+ // ponytail: a long message elides; the header has one line.
+ width: Math.min(implicitWidth, 420)
+ elide: Text.ElideRight
+ text: bar.error !== "" ? bar.error
+ : !bar.dirty ? bar.notice
+ : !bar.valid ? (bar.note || "fix the fields marked red") : "unsaved changes"
+ color: bar.error !== "" ? Theme.red
+ : !bar.dirty ? bar.noticeColor
+ : bar.valid ? Theme.yellow : Theme.red
font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 }
}
Button {