Skip to main content

max / makeover-immediate

2.3 KB · 60 lines History Blame Raw
1 # makeover-immediate
2
3 The immediate-mode renderer for [`makeover-layout`]https://makenot.work/git/max/makeover-layout.
4
5 It is the harshest renderer the description has to survive: no `box-shadow`,
6 no `inset`, no cascade, no retained tree to mutate, and one stroke per widget
7 with no per-side control. A two-tone lit edge is not something egui can be
8 configured into producing, so it is painted by hand here, once, rather than in
9 every consuming app.
10
11 Named for the mode rather than the library, the way `makeover-tui` is named
12 for the target and not for ratatui. Immediate mode is the constraint that
13 separates this renderer from the other two; egui is the backend it is written
14 against.
15
16 ## What it owns
17
18 The expression, and nothing else. Two mitred polylines for a bevel and a
19 `Frame` for a filled region.
20
21 It no longer owns a substitution. This renderer briefly supplied the page where
22 a theme had no `surface-well`, which was a stand-in for a token that did not
23 exist yet; makeover derives it from 2.3.0 and every consumer reads it, so
24 `Palette::well` is a required `Color32` rather than an `Option`.
25
26 It owns no colours and no sizes. `Palette` is handed in already resolved, and
27 every radius, margin and stroke width arrives in `FrameStyle`. That is why there
28 is no dependency on `makeover`: the app already resolves a theme, and pinning a
29 renderer to a colour crate's version would buy nothing.
30
31 ## Usage
32
33 ```rust
34 use makeover_immediate::{frame, FrameStyle, Palette};
35 use makeover_layout::Depth;
36
37 frame(ui, Depth::Raised, &palette, style, |ui| {
38 ui.label("a card laid on the panel it sits in");
39 });
40 ```
41
42 A pressed control is `Depth::Raised.pressed()`. A stylesheet can say that once
43 and let the cascade carry it; an immediate-mode renderer has nowhere to put it,
44 so every call site decides, which is exactly why the description states the rule
45 instead of each widget re-deriving it.
46
47 ## Status
48
49 On crates.io at 0.1.0, published 2026-07-28 once three renderers had exercised
50 the vocabulary, which was the sequencing gate: a description with one renderer
51 is an API with extra steps.
52
53 First consumer is audiofiles, the only Make Creative app that is egui and the
54 only one with no CSS. Design lives in the wiki note `makeover-immediate`; the backlog
55 is in GoingsOn under the project of the same name.
56
57 ## Licence
58
59 MIT.
60