aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/SaveBar.qml
diff options
context:
space:
mode:
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 {