类型 ComboboxChipsLayout

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

type ComboboxChipsLayout struct {
	Bounds ui.Rect
	Chips  []ui.Rect
	Input  ui.Rect
}

ComboboxChipsLayout reports where PaintComboboxChips put everything. Chips holds one rectangle per chip, in order; Input is the space left for the query after the last chip (at least 64 wide, wrapped onto a new line when less room remains).

构造函数

PaintComboboxChips#

func PaintComboboxChips(canvas *ui.Canvas, theme ui.Theme, bounds ui.Rect, chips []ComboboxChip, options ComboboxChipsOptions, dst []ui.Rect) ComboboxChipsLayout

PaintComboboxChips paints Vega's ComboboxChips: an input-like surface whose chips and query input wrap onto as many lines as they need (gap-1.5, min height of one control). The height of bounds is ignored: the result's Bounds has the height the content needs, so the container grows with its chips. chips is a parameter of its own, not a field of options, so a caller's array of them can stay on its stack. dst receives the chip rectangles (pass dst[:0] of a reused slice to stay allocation free).