From 670452de94e0f3e0bf5719acec28a9b02e929642 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 29 Oct 2026 17:13:53 +0100 Subject: wallpaper: engine page commits like the others, Start changes at once The page was the only settings page without the header's buttons, and it switched the engine from a checkbox beside the interval. Both looked like the engine had been started when it had not: - The minutes field saved on editingFinished, which needs Enter or a focus change. Clicking the checkbox takes neither, so a typed 1 was left at 30 and the first change was half an hour away. - Even at the right interval, the first change waited one full interval, so starting the engine did nothing visible. The interval and the two sources are now a draft in WallEngine, updated on every keystroke, and the header carries the state ("running, next change at hh:mm", "stopped", "unsaved changes") with Reset, Stop and Start, which reads Apply while running. Start commits the draft, sets the homes and changes the wallpapers straight away; Apply commits and restarts the timer. Hearts stay undrafted, written as clicked. Co-Authored-By: Claude Opus 5.5 --- desktop/modules/appearance/WallEngineModule.qml | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'desktop/modules/appearance/WallEngineModule.qml') diff --git a/desktop/modules/appearance/WallEngineModule.qml b/desktop/modules/appearance/WallEngineModule.qml index e907695..5b8a39c 100644 --- a/desktop/modules/appearance/WallEngineModule.qml +++ b/desktop/modules/appearance/WallEngineModule.qml @@ -19,6 +19,7 @@ Module { // nf-fa-shuffle, present in Inconsolata Nerd Font. icon: "\uf074" settings: true + dirty: WallEngine.dirty group: "Appearance" keywords: ["wallpaper", "timer", "rotate", "rotation", "shuffle", "slideshow", "heart"] @@ -30,6 +31,38 @@ Module { page: Component { Page { title: "Wallpaper engine" + // SaveBar's place, not SaveBar: the engine is started and stopped + // here as well as saved, and its state is what the header reports. + actions: Component { + Row { + spacing: 8 + Text { + anchors.verticalCenter: parent.verticalCenter + text: WallEngine.dirty ? "unsaved changes" + : WallEngine.on ? "running, next change at " + + Qt.formatTime(new Date(WallEngine.nextAt), "hh:mm") + : "stopped" + color: WallEngine.dirty ? Theme.yellow : WallEngine.on ? Theme.green : Theme.overlay + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 4 } + } + Button { + visible: WallEngine.dirty + text: "Reset" + onClicked: WallEngine.reset() + } + Button { + visible: WallEngine.on + text: "Stop" + enabled: !Wallpapers.applying + onClicked: WallEngine.stop() + } + Button { + text: WallEngine.on ? "Apply" : "Start" + enabled: (!WallEngine.on || WallEngine.dirty) && !Wallpapers.applying + onClicked: WallEngine.on ? WallEngine.apply() : WallEngine.start() + } + } + } WallEngineTab { width: parent.width } } } -- cgit v1.2.3