类型 Collapsible

API 文档由 Go 源码生成,内容为英文。

type Collapsible struct {
	// contains filtered or unexported fields
}

Collapsible paints one unstyled disclosure trigger. The official primitive intentionally adds no surface or icon; callers compose those explicitly. The application owns open state and paints content into the returned bounds.

构造函数

BeginCollapsible#

func BeginCollapsible(canvas *ui.Canvas, theme ui.Theme, id ui.ID, bounds ui.Rect) Collapsible

BeginCollapsible starts a disclosure container declaration.

方法

Bare#

func (collapsible Collapsible) Bare(label string, open bool, contentHeight float32) (header, content ui.Rect)

Bare is CollapsibleTrigger without a look of its own (asChild): it reserves the trigger row, declares its hit with label and the expanded state, and paints nothing, so the caller draws any trigger it likes (a ghost icon button beside a heading, say) into the returned header. contentHeight is reserved only while open; content is empty while closed.

Disabled#

func (collapsible Collapsible) Disabled() Collapsible

Disabled renders and routes the trigger as inert.

Paint#

func (collapsible Collapsible) Paint(title string, open bool, contentHeight float32) ui.Rect

Paint draws the trigger label. contentHeight is reserved only while open; the returned rectangle is empty while closed.