BeginToggleGroup#
func BeginToggleGroup(canvas *ui.Canvas, theme ui.Theme, bounds ui.Rect, options []ToggleGroupOption) ToggleGroupBeginToggleGroup starts a horizontal toggle group.
API 文档由 Go 源码生成,内容为英文。
type ToggleGroup struct {
// tabStop is the one item Tab reaches; arrows move among the others.
}ToggleGroup paints compact Base UI-style toggles. The default treatment is borderless with eight logical pixels between items; Spacing(0) joins the items into one connected control, rounded only at its outer corners, with hairlines between outline items.
BeginToggleGroup#func BeginToggleGroup(canvas *ui.Canvas, theme ui.Theme, bounds ui.Rect, options []ToggleGroupOption) ToggleGroupBeginToggleGroup starts a horizontal toggle group.
BoundsWidth#func (group ToggleGroup) BoundsWidth() float32BoundsWidth is the width the group paints at: the bounds', or with SizeToFit the width its items need.
Disabled#func (group ToggleGroup) Disabled() ToggleGroupDisabled renders every option as inert.
Large#func (group ToggleGroup) Large() ToggleGroupLarge selects the large item size.
Outline#func (group ToggleGroup) Outline() ToggleGroupOutline selects the bordered item variant.
Paint#func (group ToggleGroup) Paint() ToggleGroupResultPaint draws stable per-option surfaces and hit regions.
SizeToFit#func (group ToggleGroup) SizeToFit() ToggleGroupSizeToFit sizes every item to its label (px-2.5, px-2 when joined, never narrower than tall) instead of splitting the bounds' width equally; the group is as wide as its items, or as the widest item when vertical. BoundsWidth reports it.
Small#func (group ToggleGroup) Small() ToggleGroupSmall selects the compact item size.
Spacing#func (group ToggleGroup) Spacing(spacing float32) ToggleGroupSpacing sets logical pixels between items. Zero joins the items.
Vertical#func (group ToggleGroup) Vertical() ToggleGroupVertical lays options out in a column.