ui

package
v0.0.0-...-19fadcf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ColorPalet = []uint32{
	0xaf0000,
	0x74FBEA,
	0x89F94F,
	0xFFFC67,
	0xFE968D,
	0xFF8EC6,

	0x00A1FE,
	0x1EE5CE,
	0x60D838,
	0xF9E231,
	0xFF634D,
	0xEE5FA7,

	0x0376BB,
	0x05A89D,
	0x1EB100,
	0xF7BA00,
	0xED230D,
	0xCA2A7A,

	0x004D81,
	0x007C77,
	0x047101,
	0xFF9400,
	0xB51700,
	0x9A1860,

	0xFFFFFF,
	0xD5D5D5,
	0x929292,
	0x646464,
	0x000000,
	0xFFC943,
}

Functions

func Background

func Background(w layout.Widget, gtx layout.Context) layout.Dimensions

func Clickable

func Clickable(gtx layout.Context, button *widget.Clickable, w layout.Widget) layout.Dimensions

Clickable lays out a rectangular clickable widget without further decoration.

Types

type ButtonLayoutStyle

type ButtonLayoutStyle struct {
	Background   color.NRGBA
	CornerRadius unit.Value
	Button       *widget.Clickable
}

func ButtonLayout

func ButtonLayout(th *material.Theme, button *widget.Clickable) ButtonLayoutStyle

func (ButtonLayoutStyle) Layout

type ButtonStyle

type ButtonStyle struct {
	Text string
	// Color is the text color.
	Color        color.NRGBA
	Font         text.Font
	TextSize     unit.Value
	Background   color.NRGBA
	CornerRadius unit.Value
	Inset        layout.Inset
	Button       *widget.Clickable
	// contains filtered or unexported fields
}

func Button

func Button(th *Theme, button *widget.Clickable, txt string) ButtonStyle

func (ButtonStyle) Layout

func (b ButtonStyle) Layout(gtx layout.Context) layout.Dimensions

type C

type C = layout.Context

type Cell

type Cell func(i, j int, gtx C)

type ColorPicker

type ColorPicker struct {
	Button     *widget.Clickable
	Background color.NRGBA
	// Color is the icon color.
	Size  unit.Value
	Inset layout.Inset

	Color color.NRGBA
	// contains filtered or unexported fields
}

func Color

func Color(th *Theme, col color.NRGBA) *ColorPicker

func (*ColorPicker) Event

func (cp *ColorPicker) Event(gtx C) (col *color.RGBA)

func (*ColorPicker) Layout

func (cp *ColorPicker) Layout(gtx C) D

type D

type D = layout.Dimensions

func Title

func Title(th *Theme, txt string, gtx C) D

type EditorStyle

type EditorStyle struct {
	Font     text.Font
	TextSize unit.Value
	// Color is the text color.
	Color color.NRGBA
	// Hint contains the text displayed when the editor is empty.
	Hint string
	// HintColor is the color of hint text.
	HintColor color.NRGBA
	Editor    *widget.Editor
	// contains filtered or unexported fields
}

func Editor

func Editor(th *Theme, editor *widget.Editor, hint string) EditorStyle

func (EditorStyle) Layout

func (e EditorStyle) Layout(gtx layout.Context) layout.Dimensions

type EnumMenu

type EnumMenu struct {
}

type Grid

type Grid struct {
	Columns, Rows int
}

func (Grid) Layout

func (g Grid) Layout(gtx C, cell Cell) D

type Icon

type Icon struct {
	Src  []byte
	Size unit.Value
	// contains filtered or unexported fields
}

func (*Icon) Image

func (ic *Icon) Image(c unit.Metric, col color.NRGBA) paint.ImageOp

type IconButtonStyle

type IconButtonStyle struct {
	Background color.NRGBA
	// Color is the icon color.
	Color color.NRGBA
	Icon  *widget.Icon
	// Size is the icon Size.
	Size   unit.Value
	Inset  layout.Inset
	Button *widget.Clickable
}

func IconButton

func IconButton(th *material.Theme, button *widget.Clickable, icon *widget.Icon) IconButtonStyle

func (IconButtonStyle) Layout

type Input

type Input struct {
	Font     text.Font
	TextSize unit.Value
	// Color is the text color.
	Color color.NRGBA
	// Hint contains the text displayed when the editor is empty.
	Hint      string
	HintColor color.NRGBA
	Editor    *widget.Editor
	// contains filtered or unexported fields
}

func InputText

func InputText(th *Theme, editor *widget.Editor, hint string) *Input

func (*Input) Event

func (in *Input) Event(gtx C)

func (Input) Layout

func (e Input) Layout(gtx C) D

type InputNumberStyle

type InputNumberStyle struct {
	Value    int
	Font     text.Font
	TextSize unit.Value
	// Color is the text color.§
	Color color.NRGBA
	// Hint contains the text displayed when the editor is empty.
	Editor *widget.Editor
	// contains filtered or unexported fields
}

func InputNumber

func InputNumber(th *Theme, val int) *InputNumberStyle

func (*InputNumberStyle) Event

func (in *InputNumberStyle) Event(gtx C)

func (*InputNumberStyle) Layout

func (in *InputNumberStyle) Layout(gtx C) D

type ItemStyle

type ItemStyle struct {
	Background color.NRGBA
	// Color is the icon color.
	Color color.NRGBA
	Icon  *widget.Icon
	// Size is the icon Size.
	Size   unit.Value
	Inset  layout.Inset
	Button *widget.Clickable
}

func Item

func Item(th *Theme, button *widget.Clickable, icon *widget.Icon) ItemStyle

func (ItemStyle) Layout

func (b ItemStyle) Layout(gtx layout.Context) layout.Dimensions

type LabelStyle

type LabelStyle struct {
	// Face defines the text style.
	Font text.Font
	// Color is the text color.
	Color color.NRGBA
	// Alignment specify the text alignment.
	Alignment text.Alignment
	// MaxLines limits the number of lines. Zero means no limit.
	MaxLines int
	Text     string
	TextSize unit.Value
	// contains filtered or unexported fields
}

func Body1

func Body1(th *Theme, txt string) LabelStyle

func Body2

func Body2(th *Theme, txt string) LabelStyle

func Caption

func Caption(th *Theme, txt string) LabelStyle

func H1

func H1(th *Theme, txt string) LabelStyle

func H2

func H2(th *Theme, txt string) LabelStyle

func H3

func H3(th *Theme, txt string) LabelStyle

func H4

func H4(th *Theme, txt string) LabelStyle

func H5

func H5(th *Theme, txt string) LabelStyle

func H6

func H6(th *Theme, txt string) LabelStyle

func Label

func Label(th *Theme, size unit.Value, txt string) LabelStyle

func (LabelStyle) Layout

func (l LabelStyle) Layout(gtx layout.Context) layout.Dimensions
type MenuStyle struct{}
func Menu() MenuStyle
func (m MenuStyle) Layout(gtx C, widgets ...layout.Widget) D

type Theme

type Theme struct {
	Shaper text.Shaper
	Color  struct {
		Primary color.NRGBA
		Light   color.NRGBA
		Dark    color.NRGBA
		Text    color.NRGBA
		Hint    color.NRGBA
		InvText color.NRGBA
	}
	TextSize unit.Value
}
func MenuTheme(fontCollection []text.FontFace) *Theme

type Widgets

type Widgets []layout.Widget

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL