struct
Tessell::UI::Decl
- Tessell::UI::Decl
- Struct
- Value
- Object
Overview
Flat declaration written by Builder into a caller-provided buffer. Carries identity (key/parent), structure kind, text, geometry and a paint token. Layout-affecting changes: kind, text, bounds, direction. Paint-only change: paint token. a11y_* fields carry the accessible metadata for this declaration; all of them default so existing call sites keep working unchanged.
Auto layout(issue #5):auto=true 的声明不使用显式 bounds,由
UI.apply_auto_layout 依核心两遍内核(padding/gap/Fraction grow/
文本测量)求解并把结果写回 Node.bounds——命中树与布局结果同源。
paint 是变更探测 token(状态变化时改变它触发 Paint 失效),不是颜色。
Defined in:
tessell/ui/builder.crConstructors
Instance Method Summary
- #a11y_enabled : Bool
- #a11y_focusable : Bool
- #a11y_name : String
- #a11y_role : A11y::Role
- #a11y_value : String
- #auto : Bool
- #bounds : Rect
- #direction : Layout::Direction
- #gap : Float32
- #key : UiKey
- #kind : DeclKind
- #padding : Insets
- #paint : UInt32
- #parent : UiKey
- #text : String
- #text_size : Float32
Constructor Detail
def self.new(key : UiKey, parent : UiKey, kind : DeclKind, text : String = "", bounds : Rect = Rect.new, direction : Layout::Direction = Layout::Direction::Vertical, paint : UInt32 = 0_u32, auto : Bool = false, padding : Insets = Insets.new, gap : Float32 = 0.0_f32, text_size : Float32 = 0.0_f32, a11y_role : A11y::Role = A11y::Role::Group, a11y_name : String = "", a11y_value : String = "", a11y_focusable : Bool = false, a11y_enabled : Bool = true)
#