Skip to main content

Module layout

Module layout 

Source

Structs§

GridLines
Where a grid’s rows and columns ended up — for drawing grid lines and designer adorners.
LayoutNode
Rect

Enums§

Align
FlexDir

Constants§

MIN_KNOB_H
Shortest a scrollbar knob gets.
SCROLLBAR_W
Width of the strip a scrollbar container reserves on its right edge.

Functions§

compute
Compute layout starting at (0,0) with given available size. Returns the root LayoutNode with absolute coordinates.
deepest_path
The path of the deepest visible node at (mx, my), clickable or not (for hover routing: which scroll view is under the cursor).
find_by_id
Find the resolved rect of the (first) node tagged id (see Widget::id). Meant for baking a widget tree’s computed positions into some other system at “measure time” (e.g. a mod reporting real-slot pixel offsets to its host) — a WinForms-style measure-then-use pass, not a per-frame call.
find_node
The (first) node tagged id — its rect plus scrolling state (LayoutNode::scroll_y, LayoutNode::scrollbar_rects, …).
hit_path
The child-index path (as in Widget::at_path) of the node hit_test finds at (mx, my); None on a miss.
hit_test
Hit-test: find deepest clickable, enabled node at (mx, my). Children only count where they’re inside their parent’s rect, so rows scrolled out of a clipping container can’t be clicked.
node_at
The node at child-index path (&[] = node).
node_at_mut
node_at, mutably.
set_focus
Walk tree and set focused = true on the node whose id matches, false on all others.