class
Tessell::UI::Builder
- Tessell::UI::Builder
- Reference
- Object
Overview
Chain builder that emits Decl records into preallocated buffers. No Node is created and the hot build path performs no allocations when buf and stack have sufficient pre-reserved capacity.
Defined in:
tessell/ui/builder.crConstructors
Instance Method Summary
-
#auto_node(key : UiKey, dir : Layout::Direction = Layout::Direction::Vertical, padding : Insets = Insets.new, gap : Float32 = 0.0_f32, paint : UInt32 = 0_u32, a11y_role : A11y::Role = A11y::Role::Group, a11y_name : String = "", a11y_value : String = "", a11y_focusable : Bool = false, a11y_enabled : Bool = true) : Nil
自动尺寸叶子/容器节点(非文本):宽高 Auto,可与 vstack/hstack 嵌套。
-
#auto_text(key : UiKey, str : String, size : Float32, paint : UInt32 = 0_u32, a11y_role : A11y::Role = A11y::Role::Group, a11y_name : String = "", a11y_value : String = "", a11y_focusable : Bool = false, a11y_enabled : Bool = true) : Nil
自动尺寸文本叶子:宽度/高度由注入的 Measurer 测量(Auto)。
- #buf : Array(Decl)
- #column(key : UiKey, bounds : Rect = Rect.new, paint : UInt32 = 0_u32, dir : Layout::Direction = Layout::Direction::Vertical, a11y_role : A11y::Role = A11y::Role::Group, a11y_name : String = "", a11y_value : String = "", a11y_focusable : Bool = false, a11y_enabled : Bool = true) : Nil
- #column(key : UiKey, bounds : Rect = Rect.new, paint : UInt32 = 0_u32, dir : Layout::Direction = Layout::Direction::Vertical, a11y_role : A11y::Role = A11y::Role::Group, a11y_name : String = "", a11y_value : String = "", a11y_focusable : Bool = false, a11y_enabled : Bool = true, & : Builder -> ) : Nil
- #current_parent : UiKey
-
#group(key : UiKey, bounds : Rect = Rect.new, dir : Layout::Direction = Layout::Direction::Vertical, paint : UInt32 = 0_u32, a11y_role : A11y::Role = A11y::Role::Group, a11y_name : String = "", a11y_value : String = "", a11y_focusable : Bool = false, a11y_enabled : Bool = true, & : Builder -> ) : Nil
Generic nested group.
- #hstack(key : UiKey, padding : Insets = Insets.new, gap : Float32 = 0.0_f32, paint : UInt32 = 0_u32, a11y_role : A11y::Role = A11y::Role::Group, a11y_name : String = "", a11y_value : String = "", a11y_focusable : Bool = false, a11y_enabled : Bool = true, & : Builder -> ) : Nil
-
#node(key : UiKey, bounds : Rect = Rect.new, dir : Layout::Direction = Layout::Direction::Vertical, paint : UInt32 = 0_u32, a11y_role : A11y::Role = A11y::Role::Group, a11y_name : String = "", a11y_value : String = "", a11y_focusable : Bool = false, a11y_enabled : Bool = true) : Nil
Leaf/group node with explicit geometry and optional direction.
- #reset(root : UiKey) : Nil
-
#row(key : UiKey, bounds : Rect = Rect.new, paint : UInt32 = 0_u32, dir : Layout::Direction = Layout::Direction::Horizontal, a11y_role : A11y::Role = A11y::Role::Group, a11y_name : String = "", a11y_value : String = "", a11y_focusable : Bool = false, a11y_enabled : Bool = true) : Nil
Directional container helpers.
- #row(key : UiKey, bounds : Rect = Rect.new, paint : UInt32 = 0_u32, dir : Layout::Direction = Layout::Direction::Horizontal, a11y_role : A11y::Role = A11y::Role::Group, a11y_name : String = "", a11y_value : String = "", a11y_focusable : Bool = false, a11y_enabled : Bool = true, & : Builder -> ) : Nil
- #stack : Array(UiKey)
-
#text(key : UiKey, str : String, bounds : Rect = Rect.new, paint : UInt32 = 0_u32, a11y_role : A11y::Role = A11y::Role::Group, a11y_name : String = "", a11y_value : String = "", a11y_focusable : Bool = false, a11y_enabled : Bool = true) : Nil
Text leaf.
-
#vstack(key : UiKey, padding : Insets = Insets.new, gap : Float32 = 0.0_f32, paint : UInt32 = 0_u32, a11y_role : A11y::Role = A11y::Role::Group, a11y_name : String = "", a11y_value : String = "", a11y_focusable : Bool = false, a11y_enabled : Bool = true, & : Builder -> ) : Nil
---- Auto layout 声明(issue #5)---- vstack/hstack 容器不写 bounds,由 UI.apply_auto_layout 依内核求解; 子项可用 auto_text(测量定尺寸)或显式 bounds(Fixed)参与排布。
Constructor Detail
Instance Method Detail
自动尺寸叶子/容器节点(非文本):宽高 Auto,可与 vstack/hstack 嵌套。
自动尺寸文本叶子:宽度/高度由注入的 Measurer 测量(Auto)。
Generic nested group.
Leaf/group node with explicit geometry and optional direction.
Directional container helpers. Optional direction argument; when a block is given the container is nested.
Text leaf. Text change is layout-affecting.
---- Auto layout 声明(issue #5)---- vstack/hstack 容器不写 bounds,由 UI.apply_auto_layout 依内核求解; 子项可用 auto_text(测量定尺寸)或显式 bounds(Fixed)参与排布。