类型 ColorSwatch

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

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

ColorSwatch is a circular color choice. The caller owns its selection and supplies a stable ID and accessible name. A transparent color means no color.

构造函数

BeginColorSwatch#

func BeginColorSwatch(canvas *ui.Canvas, theme ui.Theme, id ui.ID, bounds ui.Rect, color ui.Color) ColorSwatch

BeginColorSwatch centers a color disc inside bounds, leaving room for its selection and keyboard focus rings. The full bounds are the hit target.

方法

Disabled#

func (s ColorSwatch) Disabled() ColorSwatch

Label#

func (s ColorSwatch) Label(label string) ColorSwatch

Paint#

func (s ColorSwatch) Paint() ColorSwatchResult

Paint declares a keyboard-accessible radio choice. Its ring communicates selection independently of the color, including the no-color choice.

Selected#

func (s ColorSwatch) Selected(selected bool) ColorSwatch

TabStop#

func (s ColorSwatch) TabStop(tabStop bool) ColorSwatch

TabStop says whether Tab may enter this choice. A radio set gives its selected choice the tab stop, marks the others false, and uses RadioGroupKeyDown for arrow navigation.