From f73b88072b7abad720923dd32bae6a1e98bf64d5 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 17 Oct 2026 11:37:12 +0200 Subject: settings: every page commits from the header The Mail, Assistant and Ask presets pages got a Save and Discard pair in the page header; the rest still had their own buttons wherever their page put them: User's Save at the bottom, Wallpaper's Apply and Reset beside the mock screens, Icons' Apply and Reset under the cursor cards, HyprSunset's and HyprIdle's Save + Restart in the page. They now all sit in the header SaveBar, which takes the page's own verbs (Apply and Reset, Save + Restart) and a busy state. HyprSunset and HyprIdle had no notion of an unsaved change, so their button was always live. They now count as changed when what save() would write differs from what was read, which enables Save only then, gives Discard (a reload) something to drop, and marks them in the sidebar; a window open no longer reloads them over unsaved edits. The staged cursor moved from IconsTab into the Icons singleton so the header and the sidebar can see it. Git and autostart act a row at a time, and a theme applies on click, so those have no bar. Co-Authored-By: Claude Opus 5.5 --- desktop/SaveBar.qml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'desktop/SaveBar.qml') 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() } } -- cgit v1.2.3