Apply UI config changes live without requiring a restart#781
Conversation
bb1301d to
c3c54d0
Compare
| # Let UI elements that can update live (e.g. the dark-mode palette) | ||
| # react immediately rather than only on the next restart. | ||
| signal.configChanged.emit() |
There was a problem hiding this comment.
Similar to other comment related comments, I'd keep this more general, e.g. "Enable other UI elements to react to configuration changes." That should be clear enough as to why it's emitted without being specific to the one issue it addresses initially. Since there may other places this signal could be used, e.g. i) reordering of actions (currently updates when you change input for example) or ii) input item display mode (currently applies once you change the device tab).
|
No big changes. Also just as a heads up, in case you're thinking of complex future changes, I've played around with claude design to see what it could come up with as a refined UI style, as I personally don't like dealing with UI but the Universal theme is also kind of annoyingly space hungry, which is why I started to add compact variants. Though at some point it becomes more appropriate to ditch the Universal style entirely and roll a custom one. That was always the idea of going with QML, it forces logic and presentation to be split such that the two can be changed (mostly) independently of each other. So LLMs getting better at UI madness opens that direction. |
|
Oh other thing I remembered, the description of the option itself should be updated, to no longer mention that a restart is required. |
c3c54d0 to
57c071d
Compare
|
Done — dropped "(requires restart)" from the dark-mode option's description now that it applies live, and generalized that comment to your wording since the signal isn't dark-mode-specific. Re ditching the Universal style for a custom one — agreed that's exactly the payoff of QML's logic/presentation split; happy to help in that direction once you're further along with the compact variants. |
| Style.isDarkMode = backend.useDarkMode | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
There is already a section in Main.qml where Connections are setup, including for the signal target. (around line 436) so this should go there.
Edit: Somehow GitHub didn't post the comment yesterday :-/
57c071d to
0fbc2eb
Compare
|
Moved the |
I'm unlikely going to add more custom compact variants, what is there fixes some of the main annoyances but replicating and condensing more Universal controls is to me more of a waste of time when it's all going to be replaced by an entirely new style anyhow. I'll have to write up a design doc for how that change might happen at some point. |
Config changes that affect the UI — dark mode being the obvious one — currently only take effect on restart. This emits the existing
configChangedsignal when a config entry is written and hasMain.qmlre-apply on it, so toggling dark mode updates the palette immediately.Per your note on #778, treat this as a starting point rather than a finished design — it's the smallest thing that works. If there's a direction you'd rather Gremlin take for live config, I'm glad to redo it that way; I mostly wanted something concrete to react to.
Scoped to dark mode for now. Action-icon glyphs won't recolor live yet since they're cached — that's a separate follow-up, not in here.