Built-in settings dialog opened from a panel gear button

- New spawn_settings action + '≡ Inställningar' button in the default
  panel (≡ instead of ⚙ which has ambiguous character width): opens a
  singleton settings window
- Rows: theme (cycles built-in + themes/*.toml), panel (cycles
  panels/*.toml), shadow and scrollbar toggles — keyboard (arrows/
  Enter/Esc) and mouse (click selects, click again activates)
- Shows where config.toml, themes/ and panels/ live
- Changes apply immediately and persist to config.toml via toml_edit;
  the hot-reload watcher picks up the file writes for panels
- README and --help updated with switcher/snap/copy-mode/theme docs
- Integration suite: 30/30 (gear click, dialog opens, shadow toggle
  persisted to config.toml)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-15 19:48:04 +02:00
parent b1424da4fb
commit c9a4a8fc21
7 changed files with 334 additions and 2 deletions

View File

@@ -348,6 +348,27 @@ def main():
check("hot-reload plockar upp panel-ändring", "HOTRELOAD" in text,
f"frame-tail: {text[:150]!r}")
# ── 4h. Inbyggda inställningar via kugghjulet i panelen ──────────
text = disp.frame_text(timeout=5.0, contains="Inställningar")
row0 = text[:100]
gx = row0.find("Inställningar")
check("kugghjulet syns i panelen", gx > 0)
disp.send(mouse_event({"Down": "Left"}, gx, 0))
disp.send(mouse_event({"Up": "Left"}, gx, 0))
text = disp.frame_text(timeout=5.0, contains="Tema:")
check("inställningsdialogen öppnas från panelen", "Tema:" in text
and "Skugga" in text and "config.toml" in text)
# Ned två rader till Skugga och toggla av
disp.send(key_event(code="Down"))
disp.send(key_event(code="Down"))
disp.send(key_event(code="Enter"))
time.sleep(0.5)
cfg_now = open(os.path.join(cfgdir, "config.toml")).read()
check("skugg-toggle sparas till config.toml", "shadow = false" in cfg_now,
f"config innehåller: {[l for l in cfg_now.splitlines() if 'shadow' in l]!r}")
disp.send(key_event(code="Esc"))
time.sleep(0.3)
# ── 5. Popup + popup_result via Enter ───────────────────────────
app.send({
"type": "spawn_popup", "message": "Integrationstest?",