feat(theme): themes as files (theme crate: toml subset + ints, contrast check, wire); whimsy dark + light; display reads themes/, serves THEME/THEME_NAME, init SET_THEME -> THEME_CHANGED to all windows, bar themed; k-ui follows; settings appearance; init keeps choice in sealed users/<id>/settings/, reapplies at sign-in + display restart

This commit is contained in:
2026-10-28 13:36:57 +01:00
parent 29becf297c
commit 6827e1455d
43 changed files with 1140 additions and 179 deletions

View File

@@ -94,6 +94,24 @@ pub mod window {
/// From init (unbadged) only: word 1 a launcher's badge, which has
/// gone; every window it opened closes.
pub const FORGET: usize = 8;
/// Through a window: word 1 a part (0 to `THEME_WORDS / 2 - 1`) of
/// the theme in use, as `theme::wire` words it. Reply `[OK, changes |
/// index << 32, word, word]`: `changes` counts switches (a client that
/// sees it move mid-read starts over); `index` is the theme's place in
/// `THEME_NAME`'s list.
pub const THEME: usize = 9;
pub const THEME_WORDS: usize = 8;
/// Through a window: word 1 an index. Reply `[OK, name]` (`pack_name`)
/// for each theme the display has, `MALFORMED` past the last.
pub const THEME_NAME: usize = 10;
/// From init (unbadged) only: the theme named in words 1..4 (empty:
/// the default) is now in use; `MALFORMED` if there is none by that
/// name.
pub const SET_THEME: usize = 11;
/// The event (in place of an input event's tag) every window gets when
/// the theme changes: ask for it again.
pub const THEME_CHANGED: usize = 16;
/// The function key that brings the next window to the front; the
/// display keeps it to itself.
pub const SWITCH_KEY: usize = 1;

View File

@@ -23,6 +23,10 @@ pub const SIGN_OUT: usize = 1;
/// Through the same copy: who is signed in. Reply `[role, name...]`, the
/// name in three words (`types::name`); role as in `role`.
pub const WHO: usize = 2;
/// Through the same copy: the signed-in user's theme is now the one named
/// in words 1..4 (`types::name`; empty: the default). Kept in their folder
/// and shown at once. Reply `[OK, ..]`, or `MALFORMED`.
pub const SET_THEME: usize = 3;
pub mod role {
pub const OWNER: usize = 1;