Skip to main content

Module host

Module host 

Source
Expand description

Columns, narrowing, cell parts and the sort caret, over egui_extras. The design system, handed to egui as a Style.

Every other module here draws with the palette. This one hands the palette to egui itself, so that the widgets egui draws on its own account — a button’s fill, a text field’s well, a scrollbar, a checkbox, the frame around a window — wear the same theme as the ones this crate paints.

§Why this is not the app’s job, though it has been

Palette is twenty-five colours and nothing else, so before this module an app got the colours for described content and inherited egui’s own defaults for everything else. That is not a small residue. audiofiles discovered it three separate times in one afternoon, each time as a defect found by measurement rather than by reading:

  • every control was 18 points high, egui’s interact_size, against a 24-point floor;
  • every table column heading was 9 points, egui’s TextStyle::Small, under the 11 points at which text stops being readable;
  • every window offered a collapse triangle, egui’s default, on screens with no collapsed state to show.

None of those were choices. They were what egui ships with, surviving because nothing had said otherwise, and the app that found them then wrote about a hundred and seventy lines of mapping by hand. The next consumer would have written them again, differently, and a fourth defect would have waited for a fourth measurement.

§What is here and what is deliberately not

[visuals] is the colour half: every fill, stroke, shadow and corner egui draws from, derived from a Palette. [spacing] and [text_styles] are the metric half, derived from makeover-geometry’s scale, and [style] composes all three.

What is not here is anything an app should still decide. The density it draws at, the corner radius its buttons take, which theme is loaded: those are arguments. This module maps a resolved design system onto egui and holds no opinion of its own.

Functions§

is_light
Whether this palette’s page is a light surface.
spacing
egui’s spacing, from the relational scale.
style
The whole design system as one egui Style.
text_styles
egui’s text styles, from the type scale.
visuals
The colours egui draws its own widgets with, from this palette.