Expand description
The egui layer of egui-pop (layer L2, see ADR 0001): what an application framework needs from egui, below the application API.
theme: design tokens into egui’s style, typed tokens in the context;focus: focus scopes and the focus chain, rebuilt each pass;frame: a window’s own title bar and resize edges, publishing their hit regions in physical pixels;focus_mode: whether the pointer gives the keyboard (click or hover, as the window manager does or as the user chose);keys: the key dispatcher (chords, consumption, traces);motion: the motion clock (frozen in tests, still under reduced motion) and the delayed busy indicator;layers: ranks fixing the order of the foreground layers (lying-over zones, then overlays, then menus and popups);overlay: the overlay stack (top-layer dismissal, modality, focus restore);band: the header band a movable dialog or a palette is dragged by;field: a field’s state (modified, required, invalid, disabled with a reason, read-only, pending) drawn, announced and reported;input: the decorated input (placeholder, slots, clear, attached and split buttons, a dropdown) and the split button;tab: Tab order in focus scopes (reading order, indices, groups; cycling in a modal) and F6 between panels;regions: F6 through a window’s parts, built on focus scopes;param: the editor a value descriptor calls for, in the three binding modes;slider: darktable-style sliders (soft and hard range, fine and coarse, reset, typed expressions, a quad button), logarithmic, on a gradient track, or a range with two thumbs; a hook on every change;progress: progress bars, rings, meters and spinners (delayed), on the motion clock, named for assistive technologies;placeholder: skeletons standing in for loading content, and empty states;late: a cell for a value arriving after asynchronous work (pending, fresh, refreshing, failed with Retry), its size kept;placement: floating elements placed with flip and shift;pointer: the pointer gestures in force (the profile’s table canvases read) and the wheel read raw, unit and modifiers kept;scale: the window’s scales, crisp strokes, the scale-changed signal, the interface zoom’s steps;a11y: accessible names and an announcer;strings: the library’s own strings, by key, with English fallbacks;icon: icons by role, sized and coloured from tokens;areas: the area registry: what each interactive area writes (display, navigate, edit), an edit area’s grips at rest, cursor and hover card drawn by the framework, inert while its panel is stale;hover_card: rich hover cards (formatted text, rows, live values, command links) next to any widget, read by agents as data;indicator: micro-indicators (dots and LEDs, badges, pips, flags, swatches, icons by state) drawn by the kit, passive or buttons, inline or on a widget, recorded for agents;note: an inline message in sentences (an error, a warning), wrapped, selectable and copyable, announced to screen readers;ui: layout helpers named by role on egui’sUi(text roles, spacing by intent, a card and a button in a tone);sections: collapsible sections stacked in a panel, each a band over its own scrolling body, folded and resized, remembered;fold: a group folding inside a panel under its header band, and a hand-built tree’s rows with their toggles, kept by id;persist: documents written atomically, with a backup and migrations;fault: fault boundaries showing an error card on panic;binding: plain, bound and watch-only values;latest: a slow load following a selection, the latest asked winning, nothing run behind a hidden panel;thumbnail: thumbnails and a virtualised grid of them;rating: rating stars, edited (a preview under the pointer, the current value as a ghost, a click on it clears) or shown, drawn by the kit;widgets: egui’s checkbox, radio button, selectable row and combo box arrow drawn through the kit, and a toggle chip;state: typed slots for the state kept in egui’s memory, listed by the debug bridge;debug: the debug bridge and its collectors;inspect: the element picker behind devtools’ inspect mode.
Re-exports§
pub use state::lock;pub use egui;pub use egui_pop_model as model;pub use egui_pop_tokens as tokens;
Modules§
- a11y
- Accessibility helpers: names for custom widgets, and an announcer whose messages screen readers read out (an AccessKit live region).
- areas
- The area registry: what each interactive area writes, declared to the framework, which draws the affordance so a person tells at a glance what only shows from what edits.
- band
- A header band: the handle a movable surface (a movable dialog, a palette) is dragged by. It sits at the top of a frame’s content, its fill reaching the frame’s edges, with a separator below it and the move cursor over it.
- binding
- Three ways to bind a widget’s value (ADR 0009): plain
&mut Tas in egui, bound to a value store (writes with an origin, a drag is one gesture, listeners told), or watch-only. - canvas
- The canvas in use, and the navigation commands sent to it.
- compact
- Controls for dense rows, where a control has a slot of a given size
and no label beside it (a HUD’s parts, a property sheet, a card’s
fold): a choice in a compact cell and a menu row. The scrub field is
the slider’s
scrublook, and a text in a compact cell the decorated input’scell. - debug
- The debug bridge: collectors that describe a part of the running
application, snapshot it as JSON and act on it. Every call returns a
Feedbackblock, success or not, saying what happened and whether anything changed; actions that change something are flaggedmutates. Agents, test tools and debug pages use the same bridge. - fault
- Fault boundaries: a panel whose drawing code panics shows an error card
instead of taking the application down. The panic is caught
(
catch_unwind), logged, and kept until the user retries. - field
- A field’s state drawn, announced and reported: the egui side of
egui_pop_model::field. - focus
- Focus scopes and the focus chain (ADR 0007).
- focus_
mode - Whether the pointer gives the keyboard: as the window manager does
between windows (
system), or as the user chose (click,hover). - fold
- Folds inside a panel: a group whose header row folds and opens its
body (
Fold), and a row of a hand-built tree with its disclosure toggle (TreeRow), for the folds that are neither a whole side bar of stacked sections (crate::sections::Sections) nor a data view’s tree. - fonts
- Text fonts from the theme: the families named by
font.family.uiandfont.family.mono, at several weights. - frame
- The window’s own frame, for windows drawn without the system’s
decorations: a title bar (a caption to drag, double click to
maximize, the minimize, maximize and close buttons, room for a logo
and for the application’s items) and resize edges along the window’s
sides, never thinner than
MIN_GRIP_PXphysical pixels. - hover_
card - Rich hover cards: the tier between a tooltip and a popover. A card opens after the hover delay on a widget, stays open while the pointer moves onto it (so its links can be clicked), and closes on leave after a short grace, on Escape or on a click elsewhere.
- icon
- Icons by role: an
Iconnames what the icon means (Check,Search,Warning), never a codepoint. With thephosphorfeature the Phosphor font (throughegui-phosphor, MIT) is added to the context as a family of its own and icons are drawn from it; without it, or for the marks that are always painted, the icon is painted with lines and fills. Either way the icon is sized by itsSizeand coloured by itsTonefrom the theme’s tokens. - icon_
set - An application’s own icons: SVG files registered by name, drawn like
egui-pop’s own (
Icon::Custom) and nameable by a kit’s glyphs (glyph.<role>: "<name>"). - indicator
- Micro-indicators: the small marks that say a state in very little space, beside or on another widget. Six kinds need nothing but the theme, plus icons that follow a state:
- input
- The decorated input: one component around a text, number, path or search field, with what desktop and web toolkits put around a field.
- inspect
- The element picker behind devtools’ inspect mode: while it is on, the
widget under the pointer is outlined with a small label, a click
picks it instead of reaching it, Tab and the arrows move between
widgets and Enter picks, Escape leaves. A pick says what egui knows of
the widget (
Pick); the application side (egui_pop_api’s devtools) adds what it knows and shows it. - keys
- The key dispatcher: egui key events become chords, chords resolve through the keymap in the focus chain’s context (ADR 0007), and the keys that resolve are consumed before widgets see them, and so is what such a key sends while it is held.
- kit
- Visual kits (
docs/kit.md): what a component looks like, as data from the theme and drawing handlers, compiled once when the theme is installed. - knob
- A knob: one value on a rotary dial, from the same terms as a
Slider(soft and hard range, step, unit, default, theon_changehook) and under the same history contract: a drag is one gesture, its framesdone: falseand its end once moredone: truefrom the value before it; Escape during it puts the value back with no trace. - late
- Late values: a cell for a value that arrives after asynchronous work
(a volume’s free space, a folder’s size, a count from a database),
in four states (
Late): - latest
- A slow load that follows a selection: the latest asked wins.
- layers
- Layer ranks: a fixed order between the foreground layers of a window (ADR 0026).
- motion
- The motion clock: where spinners, travelling bars, shimmer and the
busy delay take their time from, instead of
input.timedirectly. - note
- Notes: a message in sentences shown inside a page, a form or a panel
(an error, a warning, a success, a piece of information), where a
badge (
Indicator) is too small for it. - number
- A number input (a spin box): the value typed in a field, its unit beside it, and small up and down arrows. For a value whose range is too wide for a slider (a count up to millions, days up to years).
- overlay
- The overlay stack: dialogs, popovers and menus above the interface.
- param
- A parameter widget: the editor a value descriptor calls for, in any
of the three binding modes (ADR 0009). A float or an int is a
Slider, or aNumberInputwhen its range is too wide to slide (crate::number::is_wide), a bool a check box, a choice a drop-down, three or four floats in[0, 1]a colour swatch, a text a field; every editor is named by the descriptor’s label. - persist
- The persistence driver (ADR 0008): documents saved atomically with one backup, loaded through their schema’s migrations, falling back to the backup when the main file is missing or unreadable.
- placeholder
- Placeholders: skeletons standing in for content that fills progressively (a metadata panel, a queue’s rows, parameters while they load), and empty states saying why a place is empty and what to do about it.
- placement
- Placement of a floating element (popover, menu, tooltip) next to an anchor, inside bounds: on the preferred side if it fits, else flipped to the opposite side, else on the side with more room; then shifted along the side to stay inside, and shrunk only when larger than the bounds.
- pointer
- Pointer gestures in a context: the table canvases read (a
PointerMap: what each pointer chord does per canvas kind, with the options in force), and the wheel read raw. - progress
- Progress and waiting: a bar (determinate or indeterminate, with tones
and stacked sections), a ring, a meter and a spinner with a label and
a delay, drawn by the kit (
progress-bar,progress-line,progress-fill,progress-caption,meter,meter-tick,progress-ring,spinner; docs/kit.md) on the motion clock (motion): frozen in tests, still under reduced motion. - rating
- Rating stars: zero to five stars, edited with the pointer (and the
keyboard when focusable) or only shown. One widget for every place a
rating appears: a thumbnail’s overlay, a panel, a table’s column, a
file’s facts. Its behaviour follows the photo applications it is
modelled on (
docs/rating.md): - regions
- F6 through a window’s regions: the parts of the window (an area, a palette,
the status bar), each a
focus::region. - scale
- Scale, per window. Three scales multiply into egui’s
pixels_per_point(ppp) for the window being drawn: - schema
- A small JSON Schema checker for the arguments of a command or an action: the subset that says what a call may carry, nothing more.
- sections
- Collapsible sections stacked in a panel: each a title band (a disclosure mark, a title, a count) over its own scrolling body, as a code editor’s side bar stacks its views.
- segmented
- The segmented control (
Segmented): a row of exclusive options, one selected, re-exported bywidgets. - slider
- The slider family, in the manner of darktable’s bauhaus sliders: the label and the value inside the bar, a soft range the bar spans and a hard range a typed value may reach, fine and coarse adjustment, reset on a double click, and a value typed with its unit or as an expression.
- state
- The state egui-pop keeps in egui’s memory, through typed slots.
- strings
- The strings egui-pop shows (Cancel, Retry, accessibility
descriptions, the titles of what plugins declare), by key with English
fallbacks. An application installs a
Stringsprovider (theegui-pop-i18nplugin, for instance); without one, the fallbacks are used. - tab
- Tab order and focus scopes for the keyboard: Tab moves through a
scope’s stops in reading order, or as explicit indices and groups
say (
egui_pop_model::tab); F6 moves between panels. - theme
- Themes for egui: resolved design tokens turned into egui’s [
Visuals] and [Style], installed into a [Context], and kept there as a typedTokensset for custom widgets. - thumbnail
- Thumbnails and a virtualised grid of them, from images the
application supplies (a texture and its size), with a flat
placeholder in the image’s average colour until the image is there:
no spinner per thumbnail. In this layer so that both the image tools
(
egui_pop_viewport::thumbnailre-exports it) and the file picker of the application API can draw them. - tooltip
- Tooltips drawn with the kit’s
tooltipcomponent: its fill, border, radius, padding, shadow, text colour and size, and its placement (tooltip.placement:widget, under the hovered widget from its start edge as egui’s;pointer, under the pointer from its position) withtooltip.offsetbetween them. At the pointer,tooltip.offset-xmoves it towards the end side too (its corneroffset-xacross andoffsetdown from the pointer), and where the window lacks room on the end side or below, it goes to the pointer’s other side, the same distance away, rather than being pushed back under the pointer. - ui
- Layout helpers named by role, for an application’s own layout code: text by role, spacing by intent, a card and a button in a tone, drawn from the theme’s tokens and kit.
- widgets
- egui’s small widgets drawn through the kit (
docs/kit.md): a checkbox, a radio button, a selectable row, a toggle chip, and the arrow of a combo box; and an on/offSwitch, which egui lacks. - window_
surface - What draws into a window’s own surfaces besides egui, per window, as
the part drawing it says it: the image viewport’s image surface (its
format, colour space, route, or why it has none). The window registry
(
windows.list) shows it with each window; the part sets it each frame it draws and clears it when the window closes.