Skip to main content

Module widgets

Module widgets 

Source
Expand description

Widget convenience functions over [PanelCx] and [OverlayCx].

One call registers the widget with the hook’s [Widgets] face and draws it through the library paint function (design §6.4, brief F8). The chainable lm builders are the same surface the view! macro lowers to (brief M1), retargeted off layout façade onto a ContentCx. raw re-exports the level-1 register functions for callers that draw themselves. kit is the stable component kit (button, input, select, menu, dialog, tabs, list, splitter, tooltip, toast) with one builder shape and one kit::Response.

Blackbox panels are not in this module. Overlay chain builders for modal/dropdown/context menu/popup/panel/sidebar/toolbar were left unported in F8 (they held layout façade handles); M1 does not revive them.

Modules§

kit
The component kit: one builder shape for the reusable pieces of a DOM-like app (roadmap item 10).
lm
Chainable builders, the view! surface, retargeted from &mut layout façade to a ContentCx (a [PanelCx] or an [OverlayCx]).
mobile
Drives the mobile shell widgets of uzor::ui::mobile from this frame’s input: a finger (the touch recogniser’s pans, VisualView::gestures) and the mouse (a press held on a hit target and moved) both become one Drag stream, which moves a SheetState, DrawerState or SwipeState. Releases carry a velocity, so a flick snaps to the next stop with either input.
raw
Level-1 register functions (the old lm::raw build_* list, minus the blackbox panel — design §7.2 deletes that slot).
splitter
A draggable pane separator (the DOM “dragger”): a thin line with a wider grab strip. A press on the strip starts the drag; while the button is held the pane edge follows the pointer (the engine captures the pointer for the drag-sensitive strip); the release ends it. The app owns the sizes, the splitter only reports where the edge should go.

Traits§

ContentCx
A content hook context a widget convenience function can paint into.

Functions§

button
Register and draw a button.
checkbox
Register and draw a checkbox. font is the label font shorthand.
chevron
Register and draw a chevron. The hit rect follows view.hit_area.
chrome
Register and draw a window chrome strip.
context_menu
Register and draw a context menu. The frame origin is state.x/y.
dropdown
Register and draw a dropdown panel.
modal
Register and draw a modal frame. state.position == (0, 0) keeps rect.
panel
Register and draw a panel frame (header / columns / body / footer per kind). state is the caller’s persistent scroll and sort.
popup
Register and draw a popup frame.
queue_scroll_key
Queue a keyboard scroll step for this frame (call before the frame’s scroll_begins, e.g. at the top of the panel hook, with a key the app did not use otherwise). The container that takes it glides there; see [Chain] for which one.
scroll_begin
Input half: sets the extent, applies this frame’s wheel when the pointer is over viewport (and wheel is allowed), advances inertia, follows a thumb drag, pages on a track press. Returns the offset to paint the content at.
scroll_begin_overlay
Input half: sets the extent, applies this frame’s wheel when the pointer is over viewport (and wheel is allowed), advances inertia, follows a thumb drag, pages on a track press. Returns the offset to paint the content at.
scroll_end
Output half: registers the track and thumb above the content and paints the thumb (nothing when the content fits).
scroll_end_overlay
Output half: registers the track and thumb above the content and paints the thumb (nothing when the content fits).
separator
Register and draw a separator. kind picks the hit sense (divider or resize handle); view picks the paint.
sidebar
Register and draw an edge sidebar.
text
Register and draw a text label. Hover colour is view.hovered (the library field), not a separate widget state.
toggle
Register and draw a toggle. Disabled comes from view.disabled.
toolbar
Register and draw a toolbar strip.
tooltip
Register and draw a tooltip at alpha (0.0..=1.0, caller-animated).