Expand description
Tool bar: a thin, movable strip that sits between the viewport and the timeline (its own dockable
pane, so it can also be popped out). One row of icon buttons:
Select (V) · Text (T) · Rectangle · Ellipse · Triangle · Polygon · Star · Line · Arrow · Draw (D) ·
Mask (rect/ellipse/polygon/path) · Zoom
plus a magnet button that lights up while snapping is on (S, or Settings.snap’s own N shortcut),
then, for shape tools, fill and stroke colour buttons and a stroke-width DragValue; for Draw, a
play/record button, the brush colour/width, the playback speed (0.5x / 1x / 2x) and a page toggle.
The active tool changes what a click-drag in the Preview does (see ui::preview): Select edits the
selected clip, a shape tool drags out a new Shape clip at the playhead (Shift locks its aspect ratio,
Alt grows it from the press point instead of corner-to-corner), Draw records strokes while the mouse
is down (timed, so the sketch replays), Mask edits the selected effect’s / clip’s mask.
Structs§
Enums§
- Dir 🔒
- Which way a triangle / arrow glyph points.
- Glyph 🔒
- The strip, left to right: (tool, icon, name).
Tool::Maskstands for whichever mask shape is selected (the combo next to it picks one), the shape tools each get their own button. Whaticon_buttondraws. Painted with the painter, not typed: nearly every obvious character (polygon, pencil, half-disc, magnifier, close, play, reorder arrows) is missing from Segoe UI and egui’s bundled fonts and came out as a tofu box. - Tool
Constants§
- SHAPE_
CYCLE 🔒 - The shape tools in strip order (Draw has its own key, so it is not part of the S cycle).
- STRIP 🔒
Functions§
- action_
glyph 🔒 - Built-in icon for a menu action (None = text-only). The user’s Settings → Appearance → Icons override wins over these; abstract actions stay text-only on purpose.
- color_
chip 🔒 - The label-colour swatch every label menu shows: a filled round chip. A
Button, so a caller can click it, select it or hang a menu off it. - draw_
glyph 🔒 - Paint one tool glyph inside
rect(a 24x22 button) infg. - glyph_
label 🔒 - Paint
iconwhere a plain label would go — no button chrome, no hit area. - glyph_
text_ 🔒button - A button showing
iconand thentext. Used wherever a control needs a real-world picture rather than a symbol character (half of those render as tofu boxes in Segoe UI). An emptytextgives a bare icon button, centred. - handle_
hotkeys - V / T / D / M and Shift+S switch tools (Shift+S also steps through the shape variants; M steps
through the mask variants), ignored while a text field has focus or an unlisted modifier is held.
Bare
Sis snapping’s key (seehandle_snap_hotkey), not a tool switch. Returns the new tool when it changed; the key is consumed, so calling this twice in a frame is harmless. - handle_
snap_ hotkey - Bare
S(no modifiers) toggles snapping — claimed here, ahead of the action table, so it can never race with Shift+S’s shape cycle above or with theNbinding inhotkeys.rs(Action::ToggleSnap, still live and unaffected).*snapflips in place; the caller persists it. Returns true when it fired. - icon_
button 🔒 - Bare square icon button: accent fill when active, a hover outline otherwise.
- next_
mask 🔒 - next_
shape 🔒 - on_
accent 🔒 - Readable text colour on top of the accent fill.
- same_
tool 🔒 - The Mask button lights up for every mask shape (the combo beside it picks one); everything else is an exact match.
- show
- Returns true when the tool,
*snapor the style changed (the app may want to repaint the preview overlay).snapisSettings.snap— owned by the app, not this strip, so it comes in by reference. - style_
controls 🔒 - Style controls for the active tool. Returns true when anything changed.
- tool_
hotkey - Single-key shortcut of a tool (used for the tooltips and by
handle_hotkeys). The shape tools cycle on Shift+S instead (bareStoggles snapping), so their tooltip is built by hand inshow.