Skip to main content

Module preview

Module preview 

Source
Expand description

The four open decisions (spec section 9) as values, the fonts each font option draws with, and the whole-app PREVIEW of the theme.

The preview is developer-only and never saved: it is off at start-up, and with it off (and the gallery closed) nothing here runs. Turning it on snapshots egui’s dark and light styles and installs the themed ones; turning it off puts the snapshot back, so the app returns to exactly the style it had.

FONTS. The repo ships no font file, and which font the refresh uses is the owner’s decision, so neither option adds one here:

  • option A (ship a UI font) is previewed from a font file OUTSIDE the repo, named by BREP_UI_PREVIEW_FONT (a variable font supplies its own semibold; BREP_UI_PREVIEW_FONT_SEMIBOLD names a static one), or from an installed “Inter” family;
  • option B (the OS’s UI font) is whatever fontconfig answers sans-serif. The faces are bound to two EXTRA font families, UI_FAMILY and UI_STRONG_FAMILY; egui’s own Proportional and Monospace families are not touched, so text outside the gallery and the preview lays out as before.

Structs§

Choices
The four decisions as currently chosen in the gallery. The defaults are the spec’s proposals; the font has no proposal, so it starts on B (today’s no-font-file rule).
Preview
The whole-app preview: the theme written into egui’s global styles.
PreviewFonts
The preview’s fonts: the two extra families, bound on demand and removed again when neither the gallery nor the preview needs them.

Enums§

FontChoice
Decision 1: the font.
LightScope
Decision 4: whether the light theme is in the first release of the refresh.
View
Which theme the gallery window itself is drawn in.

Constants§

UI_FAMILY
UI_STRONG_FAMILY

Functions§

theme_for
The theme choices describe, in mode.