类型 FieldStack

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

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

FieldStack hands out the rows of a FieldSet or a FieldGroup top to bottom with the gap Vega puts between them. It only lays out: every row is a Field (or a legend, a separator, a nested group) the caller paints into it.

set := components.BeginFieldGroup(theme, area)
name := components.BeginField(canvas, theme, set.Next(fieldHeight))

构造函数

BeginFieldGroup#

func BeginFieldGroup(theme ui.Theme, bounds ui.Rect) FieldStack

BeginFieldGroup starts a field group: rows 28 apart (gap-7).

BeginFieldSet#

func BeginFieldSet(theme ui.Theme, bounds ui.Rect) FieldStack

BeginFieldSet starts a field set: rows 24 apart (gap-6 at the default density, 1.5 padding units).

方法

Height#

func (stack FieldStack) Height() float32

Height is the height of the rows handed out so far, gaps included.

Nested#

func (stack FieldStack) Nested(theme ui.Theme, bounds ui.Rect) FieldStack

Nested is the stack for a group inside a group: rows 16 apart (gap-4).

Next#

func (stack *FieldStack) Next(height float32) ui.Rect

Next returns the next row, height high and as wide as the stack, below the previous one and a gap further down.

Tight#

func (stack FieldStack) Tight(theme ui.Theme) FieldStack

Tight switches the stack to the 12 pixel gap (gap-3) of a set that holds a checkbox or radio group.