Expand description
The NeXTSTEP egui theme for the Improv GUI.
Lotus Improv ran on NeXTSTEP’s 2-bit grayscale display: four grays and no
color at all. This module builds an [egui::Style] from exactly those four
levels (plus the scroller trough), with square corners and 1 px strokes.
Roles follow docs/reviews/2026-10-03-nextstep-visual-spec.md §1. Text is
the bundled Arimo (§2), a Helvetica-metric face, installed by
install_fonts. It is purely cosmetic: no behavior depends on it.
Constants§
- ARROW
- §4.8 arrow buttons: 18 px squares.
- BLACK
- Key-window title bars, grid rules, text, bevel dark edges.
- BOLD
- The font name and family of the bold face, for window and menu titles.
- DARK_
GRAY - Desktop, category tile faces, non-key title bars, disabled / weak text.
- LIGHT_
GRAY - Window and panel background, control faces, the selection fill.
- TEXT_
SIZE 🔒 - NeXT’s one text size: Helvetica 12 everywhere (§2).
- TROUGH
- The scroller trough (the one value outside the four levels, spec §4.8).
- WHITE
- Grid cells, text fields, pressed faces, bevel light edges.
Functions§
- apply
- Apply the NeXTSTEP look to
ctxat startup: pin the light theme slot first, so a system theme change can’t swap in egui’s stock visuals, then setnext_styleinto that slot andinstall_fonts. - content
- Undo the trough color inside scrolled content, so text edits stay WHITE.
- hscroller_
chrome - Draw and run a horizontal scroller in
barforout(an area whose own bar is hidden): grouped arrows scrolllinepoints per click, the beveled knob drags, and a click in the trough beside the knob pages by a view. - hscroller_
rects - The §4.4 horizontal scroller in
bar(the bottom strip, right of the row tiles): its left and right arrow buttons grouped at the LEFT end, as in the reference, then the knob’s track. - install_
fonts - Register the bundled Arimo with
ctx: Regular first in the proportional family, ahead of egui’s default fonts (kept as glyph fallback), and Bold as the named familyBOLD. [TextStyle::Heading] is pointed at the bold family here rather than innext_style, because a style naming an unregistered family panics when text is laid out; call this afterset_style. Monospace is left as egui’s default. - knob_
drag 🔒 - Drag
knob(it senses clicks too, so the egui bar under it never jumps): the scroll offset change for this frame’s drag, mapping the knob’s free travel (track_lenminus the knob) onto themaxscrollable points. - knob_
span 🔒 - Where a scroller knob spans along
trackfor aviewlong window atoffsetintocontent: grown tomin_len, kept inside the track. - next_
scroll - Show
areaNeXT-style: the bar always there, its troughTROUGH, withscroller_chromeon top (one line = one interact row). egui paints the trough withextreme_bg_color, which is WHITE for text edits, so it is swapped for the scroller only and restored foradd. - next_
style - Build the NeXTSTEP [
Style]. Applied once at startup byapply. - raised 🔒
- A raised NeXT face:
LIGHT_GRAYwith a white top-left, black bottom-right 1 px bevel. - scroll_
to 🔒 - Store
offset(clamped to0..=max) onaxisofout’s area if it moved, and repaint so the area shows it. - scroller_
chrome - Repaint a shown vertical scroller NeXT-style: a knob with a 1 px bevel
(white top-left, black bottom-right) above two grouped arrow buttons, each
click scrolling
linepoints.outeris the area plus its bar as laid out (out.inner_rectis the pre-shrink rect, so it can’t be used). The knob drags 1:1 with the pointer (ours, not egui’s whole-trough mapping), so it also works when the bar is drawn at a viewport edge egui’s own bar is scrolled away from (a grid wider than its window). - scroller_
rects - The vertical trough at the right of a non-floating scroll area’s
outerrect (area plus bar), then its up and down arrow buttons grouped at the trough’s bottom end.