save colours on change instead of input

`input` is supposed to be fired on every adjustment to the picker
whereas `change` is only fired when the picker is accepted, but qt
seems to treat both as the latter, so this is currently a no-op
This commit is contained in:
llama 2025-09-10 20:58:38 +08:00
parent 7bde95f221
commit 1df93b02f8
No known key found for this signature in database
GPG key ID: 0B7543854B9413C3
2 changed files with 4 additions and 2 deletions

View file

@ -134,9 +134,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
on:input={(event) => { on:input={(event) => {
color = setColor(event); color = setColor(event);
bridgeCommand(`lastHighlightColor:${color}`); bridgeCommand(`lastHighlightColor:${color}`);
}}
on:change={() => {
setTextColor();
saveCustomColours({}); saveCustomColours({});
}} }}
on:change={() => setTextColor()}
/> />
</IconButton> </IconButton>
</WithColorHelper> </WithColorHelper>

View file

@ -153,13 +153,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
on:input={(event) => { on:input={(event) => {
color = setColor(event); color = setColor(event);
bridgeCommand(`lastTextColor:${color}`); bridgeCommand(`lastTextColor:${color}`);
saveCustomColours({});
}} }}
on:change={() => { on:change={() => {
// Delay added to work around intermittent failures on macOS/Qt6.5 // Delay added to work around intermittent failures on macOS/Qt6.5
setTimeout(() => { setTimeout(() => {
setTextColor(); setTextColor();
}, 200); }, 200);
saveCustomColours({});
}} }}
/> />
</IconButton> </IconButton>