aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/SaveBar.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/SaveBar.qml')
-rw-r--r--desktop/SaveBar.qml16
1 files changed, 11 insertions, 5 deletions
diff --git a/desktop/SaveBar.qml b/desktop/SaveBar.qml
index aa64868..fa55a15 100644
--- a/desktop/SaveBar.qml
+++ b/desktop/SaveBar.qml
@@ -13,12 +13,18 @@ import QtQuick
// Save and Discard for a settings page that edits a draft: its fields change
// the draft, and nothing reaches the file until Save. Sits in the Page header
-// through Page.actions. note says what is wrong when Save is held back.
+// through Page.actions, the one place every settings page commits from. note
+// 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.
Row {
id: bar
property bool dirty: false
property bool valid: true
property string note: ""
+ property string saveText: "Save"
+ property string discardText: "Discard"
+ property bool busy: false
signal save
signal discard
spacing: 8
@@ -31,13 +37,13 @@ Row {
font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 }
}
Button {
- text: "Discard"
- enabled: bar.dirty
+ text: bar.discardText
+ enabled: bar.dirty && !bar.busy
onClicked: bar.discard()
}
Button {
- text: "Save"
- enabled: bar.dirty && bar.valid
+ text: bar.busy ? bar.saveText + "…" : bar.saveText
+ enabled: bar.dirty && bar.valid && !bar.busy
onClicked: bar.save()
}
}