Expand description
UI framework — flexbox layout + widgets on top of yog-gfx.
Modules§
- component
- Custom components — a mod’s own reusable widgets, used from
.yuimarkup like the built-in elements (the user controls of WPF). - event
- The raw UI events a Yog screen’s
register_uihandler receives, parsed once intoUiEvent. - image
- Image widgets: natural size (asked from the host, cached) and drawing —
fitting the image into the widget per its
Stretchand cutting it to the clip rect. - layout
- scroll
- Driving a scrolling container (
widget::scroll_view()) from the raw UI events a Yog screen receives (scroll:DY,click:X:Y,drag:X:Y,release:X:Y). - text
- Text wrapping utilities shared by layout (measuring) and render (drawing).
- textbox
- Driving a single-line text input (
widget::text_box()) from the raw UI events a Yog screen receives —click:X:Y,drag:X:Y,release:X:Y,key:KEY:MODSandchar:CODEPOINT— likeScrollStatedoes for scroll views. - widget
- Widget types and styling.
Structs§
- Action
- A typed click target:
owner0 = the screen,k= items controlk;slot= the command (orAction::SELECT);index= the item index inside an items control (0 elsewhere). - Layout
Node - Rect
- Scroll
State - Scroll offset plus scrollbar-drag state of one scrolling container.
- State
Flags - Interaction state bits of a widget — see
Widget::state. - State
Styles - A widget’s state patches: each applies when the widget’s state contains its flags; later rules win.
- Style
Patch - Paint-only style overrides — never affect layout.
- Text
BoxState - Text, caret, selection and focus of one text box.
- UiRoot
- Top-level UI tree. Build it, call
layout, then [render] each frame. - Widget
- A single widget in the UI tree.
Enums§
- Align
- Dock
- WinForms-style dock — which edge(s) the widget attaches to inside its parent.
- FlexDir
- Focus
Style - How a focused widget shows its focus indicator.
- Stretch
- How an image fills the box it’s given — WPF’s
Stretch. - Text
BoxEvent - What
TextBoxState::handledid with an event. - UiEvent
- One parsed UI event — see the module docs.
- Units
- A size value — either a fixed pixel amount, a CSS-style percentage of the
parent’s own resolved content size (0.0–100.0), or
Auto(size to content/available space, this crate’s original behaviour).