Hold power actions to confirm instead of a confirm row

Logout, reboot and shut down now fill with accent liquid while held and
run once full; letting go early drains it. A tap hints to hold. Replaces
the Confirm/Cancel rows in the control center tile and dashboard tab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-11-28 01:05:11 +01:00
1 parent 1e918414d1
commit d37f9b7121
10 files changed
+350 -102

No files matched your search

+6 -1
View File
@@ -5,7 +5,12 @@ import "../core"
Singleton {
id: root
// The action being held to confirm. Its button fills while this is set and
// confirm() runs it once full; cancel() (release, Escape, closing) drains.
property string pending: ""
function needsHold(action) {
return ["logout", "reboot", "shutdown"].includes(action);
}
function request(action) {
// The built-in lock screen needs no external locker.
if (action === "lock" && ConfigService.ready && ConfigService.data.lock.enabled) {
@@ -14,7 +19,7 @@ Singleton {
}
if (!SystemService.state.power || !SystemService.state.power[action] || SystemService.acting)
return false;
if (["logout", "reboot", "shutdown"].includes(action)) {
if (needsHold(action)) {
pending = action;
return true;
}