Expand description
The immediate-mode renderer for makeover_layout.
Named for the mode, not the library, the way [makeover-tui] is named for
the target and not for ratatui. Immediate mode is the constraint that
actually separates this renderer from the other two, and egui is the
backend it is written against.
It is the harshest renderer the description has to survive: no
box-shadow, no inset, no cascade, no retained tree to mutate, and
Visuals.widgets.*.bg_stroke is a single stroke with no per-side control.
A two-tone lit edge is not something egui can be configured into producing,
so it gets painted by hand here, once, instead of in every consuming app.
§What this crate does and does not own
It owns the expression: two mitred polylines for a bevel and a Frame
for a filled region. It owns no colours and no sizes, and no longer owns a
substitution: it briefly supplied the page for a well, which was a stand-in
for surface-well before makeover derived it, and every consumer reads the
real token now. Palette is supplied by the caller,
already resolved, and every radius, margin and stroke width arrives in
FrameStyle.
That split is why the crate has no dependency on makeover itself: the app
already resolves a theme, and coupling a renderer to a colour crate’s
version would buy nothing.
§The cascade is the real difference
A stylesheet can say “a pressed button inverts its bevel” once and let the
cascade carry it. An immediate-mode renderer has nowhere to put that, so
every call site decides. makeover_layout::Depth::pressed is what keeps
the decision from being re-derived per widget.
Structs§
- Frame
Style - The geometry a framed region is drawn with.
- Palette
- The resolved colours this renderer needs, as flat values.
Functions§
- frame
- Draw a region at a given
Depth: its fill and its edge, together. - paint_
bevel - Paint a two-tone edge just inside
rect.