Skip to main content

Module ui

Module ui 

Source
Expand description

UI framework — flexbox layout + widgets on top of yog-gfx.

Modules§

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).
widget
Widget types and styling.

Structs§

LayoutNode
Rect
ScrollState
Scroll offset plus scrollbar-drag state of one scrolling container.
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
FocusStyle
How a focused widget shows its focus indicator.
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).

Functions§

set_focus
Walk tree and set focused = true on the node whose id matches, false on all others.