From 77952289f8176703eef7134262c6fd6d0d835dd6 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 21 Oct 2026 10:23:05 +0200 Subject: Switch: never set checked itself, report the new state instead The shared Switch flipped its own checked on click, which replaced the caller's binding with a constant. Every use binds checked, so after a click the switch stopped following its source: Discard on a settings draft reverted the value and left the switch showing the click. Four status rows and the headphones panel each carried a resync workaround for it. toggled now carries the new state and the switch moves only when the caller's binding does. Handlers that read checked as the new value take the argument instead; the workarounds are gone. Co-Authored-By: Claude Opus 5.5 --- desktop/modules/status/LockRow.qml | 5 ----- 1 file changed, 5 deletions(-) (limited to 'desktop/modules/status/LockRow.qml') diff --git a/desktop/modules/status/LockRow.qml b/desktop/modules/status/LockRow.qml index c59c2f1..0e711d8 100644 --- a/desktop/modules/status/LockRow.qml +++ b/desktop/modules/status/LockRow.qml @@ -105,9 +105,4 @@ Item { onToggled: row.apply(!row.lockOn) } } - - // The shared Switch's click handler writes `checked` directly, which drops - // the declarative binding above. Resync on any state change so the timer, - // statusctl or presentation mode moves the switch back into agreement. - onLockOnChanged: sw.checked = row.lockOn } -- cgit v1.2.3