struct Tessell::UI::Decl

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.cr

Constructors

Instance Method Summary

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) #

[View source]

Instance Method Detail

def a11y_enabled : Bool #

[View source]
def a11y_focusable : Bool #

[View source]
def a11y_name : String #

[View source]
def a11y_role : A11y::Role #

[View source]
def a11y_value : String #

[View source]
def auto : Bool #

[View source]
def bounds : Rect #

[View source]
def direction : Layout::Direction #

[View source]
def gap : Float32 #

[View source]
def key : UiKey #

[View source]
def kind : DeclKind #

[View source]
def padding : Insets #

[View source]
def paint : UInt32 #

[View source]
def parent : UiKey #

[View source]
def text : String #

[View source]
def text_size : Float32 #

[View source]