Skip to main content

Crate ashlar_ui

Crate ashlar_ui 

Source
Expand description

General-purpose egui components for ashlar apps.

  • Theme: tokens (design tokens, light/dark/system, interface scale), fonts (install app-supplied faces with a CJK fallback chain), theme (widget-state colouring).
  • Inputs: value_field (drag/scrub and formatted numeric fields), slider (slider, knob), swatches, search, buttons, tabs; all value edits report edit phases.
  • Text: markdown (chat replies and short documents, streaming-safe).
  • Data: virtual_list (list and table, O(visible) per frame), tree.
  • Shell: dialog, toasts, status_bar, layout, docking, printing.
  • Commands: commands (menu model and bar, palette, keymap editor, key dispatch).
  • Infrastructure: automation (ids and rects for ui.inspect/ui.click), devtools (the UI debugger: element tree with refs, injected input, waits, screenshots, inspector), cache (revision-keyed galleys and meshes), wake (frame requests with a reason, per-reason frame counts).

Apps own their data, selection, assets and command handling: components take state by reference and report what the user asked for. Domain widgets (timelines, canvases) stay in the apps and are built from these pieces.

Modules§

automation
Automation ids: every interactive component registers a stable id, label and on-screen rect each frame, so an agent can find and click controls by id and ui.inspect can report what is on screen without per-app code.
buttons
Icon-only buttons: the app picks the colours of each state and paints the icon.
cache
Revision-keyed caching of galleys, meshes and other derived paint data across frames.
commands
Commands in the UI: the menu bar, the command palette, the keymap editor and keyboard dispatch, all driven by ashlar_command::CommandInfo and ashlar_command::Keymap.
devtools
The UI debugger: drive any egui app the way a browser automation tool drives a web page. Snapshot the UI as an element tree with short refs (e12), act on refs (click, fill, press, drag…), wait for conditions, read values, take screenshots, and an in-app inspector (F12).
dialog
Modal dialog shell: title, body, and a row of buttons with keyboard defaults.
docking
Panel docking: a layout of tab groups, accordions, splits and floating groups that apps change only through validated, atomic transactions, plus drop-target resolution and an optional egui renderer that reports what the user asked for as actions.
edit
Edit phases: how a continuous gesture (a drag, a typed entry) maps onto one undo step.
fonts
Install font families from bytes the app supplies, with a CJK fallback chain.
icons
Catalogs of trusted, compiled-in monochrome SVG icons.
layout
Layout building blocks that hold no state of their own.
markdown
Markdown for chat replies and short documents: headings, paragraphs, bullet, numbered and task lists, block quotes, rules, tables and fenced code blocks (with a Copy button), and inline code, bold, italic, strike-through and links.
printing
Printer selection controls and their transient state.
search
Search field: a single-line editor with a search glyph, a clear button and Escape to clear.
slider
Slider and knob, reporting the same Edit phases as crate::value_field.
status_bar
Status bar: a thin strip along the bottom of the window with left and right sections.
swatches
A grid of colour swatches (a palette, recent colours, label colours).
tabs
Tab strips: fitting tab widths with an overflow menu, and an accessible tab hit-region that the caller paints.
theme
Widget-state colouring: the low-level step crate::tokens uses to colour egui’s widgets.
toasts
Toast notifications: a bounded queue the app pushes to, painted in a corner.
tokens
Design tokens: the colours, radii, spacing and type sizes every ashlar component reads.
tree
Tree view: an expandable hierarchy shown as a virtualized list.
value_field
Numeric drag/scrub field with an explicit edit phase.
virtual_list
Virtualized list and table: only visible rows are laid out, painted and registered, so a frame costs O(visible rows) whatever the row count.
wake
The frame scheduler: ask for frames with a named Reason, so an app can say why each frame ran.