aboutsummaryrefslogtreecommitdiffstats
path: root/desktop
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-19 09:21:35 +0200
committerDanilo M. <danix@danix.xyz>2026-10-19 09:21:35 +0200
commitd30518748d926b380557dd99b2e5bcb083aafb0a (patch)
tree85caa2c9483f31804aa2f01cdda3f77694bdac22 /desktop
parent30ada872dbd699343f2f899d4ff907e702a5ede9 (diff)
downloadquickshell-d30518748d926b380557dd99b2e5bcb083aafb0a.tar.gz
quickshell-d30518748d926b380557dd99b2e5bcb083aafb0a.zip
desktop: rebind the notification page's fields after an edit
Typing replaces a Field's value binding, so Discard left the typed text showing over the reverted draft, and a rejected timeout kept displaying. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/modules/notifications/NotificationsPage.qml14
1 files changed, 12 insertions, 2 deletions
diff --git a/desktop/modules/notifications/NotificationsPage.qml b/desktop/modules/notifications/NotificationsPage.qml
index b85a6d7..37fa2a1 100644
--- a/desktop/modules/notifications/NotificationsPage.qml
+++ b/desktop/modules/notifications/NotificationsPage.qml
@@ -48,7 +48,13 @@ Column {
visible: pg.d.timeouts[modelData[0]] !== 0
value: String(pg.d.timeouts[modelData[0]])
placeholder: "seconds"
- onEdited: { const n = parseInt(value, 10); if (n > 0 && n <= 86400) pg.setTimeout(modelData[0], n); }
+ // Typing drops the value binding too: put it back so Discard
+ // shows the draft, and a rejected entry reverts at once.
+ onEdited: {
+ const n = parseInt(value, 10);
+ value = Qt.binding(() => String(pg.d.timeouts[modelData[0]]));
+ if (n > 0 && n <= 86400) pg.setTimeout(modelData[0], n);
+ }
}
Toggle {
anchors.verticalCenter: parent.verticalCenter
@@ -80,7 +86,11 @@ Column {
anchors.verticalCenter: parent.verticalCenter
value: String(pg.d[modelData[0]])
border.color: pg.d[modelData[0]] >= 1 && pg.d[modelData[0]] <= 100 ? Qt.alpha(Theme.text, 0.12) : Theme.red
- onEdited: pg.mod.edit({ [modelData[0]]: parseInt(value, 10) || 0 })
+ onEdited: {
+ const n = parseInt(value, 10) || 0;
+ value = Qt.binding(() => String(pg.d[modelData[0]]));
+ pg.mod.edit({ [modelData[0]]: n });
+ }
}
}
}