v0.43.0: visualizer presets

Each visualizer style's settings page has a Preset drop-down and a
"Save as Preset…" button. The drop-down lists the built-in Default, your
presets, and "Edit Presets…" (rename in place, delete); it reads "Custom"
whenever the settings match no preset. Presets sync with the preferences;
the per-machine sync delay is never part of one.
This commit is contained in:
2026-10-10 01:41:01 -07:00
parent 8b42580f97
commit 599972fa1a
6 changed files with 499 additions and 2 deletions
+8
View File
@@ -224,6 +224,14 @@ persistence) → GUI (Qt widgets that read the manager and connect to its signal
lives in **`config.json`**; the dialog emits `prefs.changed` after writing
it so the widget re-reads. The laser takes every heard sample exactly once
(`_drawn` index), never the newest-decoded ones.
**Presets** (`gui/visualizer_presets.py`): per style, `STYLE_KEYS` under a
name, in `visualizer_presets` (synced; never the sync delay). `Default` is
built in and reserved. Applying one moves the dialog's *controls* (each
registers a setter in `_viz_setters`), and their own handlers save the
values, so controls and prefs can't disagree. The drop-down reads
"Custom" whenever the settings match no preset. A setting added later
must join `STYLE_KEYS` and register a setter, or presets silently skip it
(`test_every_style_key_has_a_control` pins that).
The highlight swatches can be repainted with a color picker:
`highlight_palette` overrides a slot, and `theme.highlight_color` reads
through `theme.highlight_palette`, so nothing else needs to know.