类型 Accordion

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

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

Accordion paints a vertical collection of disclosure rows. Expansion state belongs to the application; Item returns the content rectangle so arbitrary source-owned content can be painted without a component registry.

构造函数

BeginAccordion#

func BeginAccordion(canvas *ui.Canvas, theme ui.Theme, bounds ui.Rect) Accordion

BeginAccordion starts an accordion declaration. Keep item IDs and call order stable between paints so retained commands and focus targets stay stable.

方法

Disabled#

func (accordion Accordion) Disabled() Accordion

Disabled renders every item as inert.

Item#

func (accordion *Accordion) Item(id ui.ID, title string, open bool, contentHeight float32) ui.Rect

Item paints one disclosure row. contentHeight is reserved only while open; the returned rectangle is where the caller paints the item's arbitrary content. A closed item returns a zero-height rectangle at the same origin.

RemainingBounds#

func (accordion Accordion) RemainingBounds() ui.Rect

RemainingBounds returns the unused portion of the original declaration.