shell theme: the bar self-restarts now, soften the restart copy

breadbar re-execs itself on a shell.toml 'active' change and breadbox
re-reads the theme per launcher open, so a switch applies without the
user doing anything. Reword the Apply card to say so and demote the
'Restart bar & launcher' button to a fallback.
This commit is contained in:
Breadway 2026-09-02 12:06:47 +08:00
parent bfb78fd6f5
commit 16f42d5a82
2 changed files with 11 additions and 11 deletions

View file

@ -101,13 +101,11 @@
<Group title="Apply">
<Hint
text={switched
? "Restart the bar and launcher (or log out and back in) to switch to this theme."
: "A theme change takes effect when the bar and launcher restart, or on the next login."}
? "The bar restarts itself to pick up the new theme; the launcher applies it next time you open it."
: "The bar restarts itself on a theme change; the launcher applies it on its next open. Use the button below if something looks stuck."}
/>
<div class="foot">
<button class="btn primary" disabled={busy} onclick={restart}>
Restart bar &amp; launcher
</button>
<button class="btn" disabled={busy} onclick={restart}>Restart bar &amp; launcher</button>
</div>
</Group>
{/if}

View file

@ -6,12 +6,14 @@
//!
//! `bread_theme::shell::list()` enumerates every discoverable theme (user
//! config → system dir → compiled-in builtins). Setting `active` is a
//! non-destructive `toml_edit` write; a running breadbar picks the change
//! up live via its own `bread_theme::shell::watch()` (colours and CSS
//! tokens re-resolve without a restart). Two things it *cannot* hot-apply:
//! window-spec changes (a bottom-anchored theme like `daylight` moves the
//! bar), and breadbox — which reads `shell::load()` once at startup and has
//! no watch. `restart_shell_apps` covers both.
//! non-destructive `toml_edit` write.
//!
//! A running breadbar watches `shell.toml` (`bread_theme::shell::watch()`)
//! and, on an `active` change, re-execs itself so the full theme applies —
//! geometry and widget structure, not just CSS tokens. breadbox re-reads
//! the theme on each launcher open. So a plain write here is normally
//! enough; `restart_shell_apps` stays as a manual fallback (an old breadbar
//! without self-restart, or a failed re-exec).
use serde::Serialize;