decredmaterial

package
v0.0.0-...-12b188e Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: ISC Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clickable

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

Types

type Button

type Button struct {
	material.ButtonStyle
}

func (Button) Layout

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

type C

type C = layout.Context

type Card

type Card struct {
	layout.Inset
	Color color.RGBA
}

func (Card) Layout

func (c Card) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions

type CheckBoxStyle

type CheckBoxStyle struct {
	material.CheckBoxStyle
}

func (CheckBoxStyle) Layout

Layout updates the checkBox and displays it.

type Collapsible

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

func (*Collapsible) Layout

func (c *Collapsible) Layout(gtx layout.Context, header func(C) D, content func(C) D) layout.Dimensions

type D

type D = layout.Dimensions

type Editor

type Editor struct {
	material.EditorStyle

	TitleLabel Label
	ErrorLabel Label
	LineColor  color.RGBA

	//IsVisible if true, displays the paste and clear button.
	IsVisible bool
	//IsRequired if true, displays a required field text at the buttom of the editor.
	IsRequired bool
	//IsTitleLabel if true makes the title label visible.
	IsTitleLabel bool
	//Bordered if true makes the adds a border around the editor.
	Bordered bool
	// contains filtered or unexported fields
}

func (*Editor) ClearError

func (e *Editor) ClearError()

func (*Editor) IsDirty

func (e *Editor) IsDirty() bool

func (Editor) Layout

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

func (*Editor) SetError

func (e *Editor) SetError(errorText string)

func (*Editor) SetRequiredErrorText

func (e *Editor) SetRequiredErrorText(txt string)

type Icon

type Icon struct {
	*widget.Icon
}

func NewIcon

func NewIcon(data []byte) (*Icon, error)

NewIcon returns a new Icon from IconVG data.

type IconButton

type IconButton struct {
	material.IconButtonStyle
}

func (IconButton) Layout

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

type Image

type Image struct {
	// Src is the image to display.
	Src paint.ImageOp
	// Scale is the ratio of image pixels to
	// dps.
	Scale float32
}

Image is a widget that displays an image.

func (Image) Layout

func (im Image) Layout(gtx layout.Context) layout.Dimensions

type Label

type Label struct {
	material.LabelStyle
}

type Line

type Line struct {
	Height int
	Width  int
	Color  color.RGBA
}

Line represents a rectangle widget with an initial thickness of 1

func (*Line) Layout

func (l *Line) Layout(gtx C) D

Layout renders the line widget

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

func (*Modal) Layout

func (m *Modal) Layout(gtx layout.Context, widgets []func(gtx C) D, margin int) layout.Dimensions

Layout renders the modal widget to screen. The modal assumes the size of its content plus padding.

func (*Modal) SetTitle

func (m *Modal) SetTitle(title string)

type Outline

type Outline struct {
	BorderColor color.RGBA
	Weight      int
}

func (Outline) Layout

func (o Outline) Layout(gtx layout.Context, w layout.Widget) D

type Password

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

func (*Password) Layout

func (p *Password) Layout(gtx layout.Context, confirm func([]byte), cancel func()) layout.Dimensions

Layout renders the widget to screen. The confirm function passed by the calling page is called when the confirm button is clicked, and the form passes validation. The entered password is passed as an argument to the confirm func. The cancel func is called when the cancel button is clicked

type Position

type Position int

Position determines what side of the page the tab would be laid out

const (
	Top Position = iota
	Right
	Bottom
	Left
)

type ProgressBarStyle

type ProgressBarStyle struct {
	material.ProgressBarStyle
}

type RadioButton

type RadioButton struct {
	material.RadioButtonStyle
}

type ReadClipboard

type ReadClipboard struct{}

type TabItem

type TabItem struct {
	Title string

	Icon image.Image
	// contains filtered or unexported fields
}

TabItem displays a single child of a tab. Label and Icon in TabItem are optional.

func NewTabItem

func NewTabItem(title string, icon *image.Image) TabItem

func (*TabItem) Layout

func (t *TabItem) Layout(gtx layout.Context, selected int, tabPosition Position) layout.Dimensions

type Tabs

type Tabs struct {
	Size float32

	Selected int

	Position  Position
	Separator bool
	// contains filtered or unexported fields
}

Tabs displays succession of TabItems. Using the Position option, Tabs can be displayed on any four sides of a rendered page.

func NewTabs

func NewTabs(th *Theme) *Tabs

func (*Tabs) ChangeEvent

func (t *Tabs) ChangeEvent() bool

ChangeEvent returns the last change event

func (*Tabs) ChangeTab

func (t *Tabs) ChangeTab(index int)

ChangeTab changes the position of the selected tab

func (*Tabs) Layout

func (t *Tabs) Layout(gtx layout.Context, body layout.Widget) layout.Dimensions

func (*Tabs) SetTabs

func (t *Tabs) SetTabs(tabs []TabItem)

SetTabs creates a button widget for each tab item.

func (*Tabs) SetTitle

func (t *Tabs) SetTitle(title Label)

SetTitle setting the title of the tabs

type Theme

type Theme struct {
	Shaper text.Shaper
	Base   *material.Theme
	Color  struct {
		Primary    color.RGBA
		Secondary  color.RGBA
		Text       color.RGBA
		Hint       color.RGBA
		Overlay    color.RGBA
		InvText    color.RGBA
		Success    color.RGBA
		Danger     color.RGBA
		Background color.RGBA
		Surface    color.RGBA
		Gray       color.RGBA
		Black      color.RGBA
	}
	Icon struct {
		ContentCreate *widget.Icon
		ContentAdd    *widget.Icon
	}
	TextSize unit.Value

	Clipboard     chan string
	ReadClipboard chan interface{}
	// contains filtered or unexported fields
}

func NewTheme

func NewTheme(fontCollection []text.FontFace) *Theme

func (*Theme) Background

func (t *Theme) Background(gtx layout.Context, w layout.Widget)

func (*Theme) Body1

func (t *Theme) Body1(txt string) Label

func (*Theme) Body2

func (t *Theme) Body2(txt string) Label

func (*Theme) Button

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

func (*Theme) Caption

func (t *Theme) Caption(txt string) Label

func (*Theme) CheckBox

func (t *Theme) CheckBox(checkBox *widget.Bool, label string) CheckBoxStyle

func (*Theme) Collapsible

func (t *Theme) Collapsible() *Collapsible

func (*Theme) DangerButton

func (t *Theme) DangerButton(button *widget.Clickable, text string) Button

DangerButton a button with the background set to theme.Danger

func (*Theme) Editor

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

func (*Theme) ErrorAlert

func (t *Theme) ErrorAlert(gtx layout.Context, txt string) layout.Dimensions

func (*Theme) ErrorLabel

func (t *Theme) ErrorLabel(txt string) Label

func (*Theme) H1

func (t *Theme) H1(txt string) Label

func (*Theme) H2

func (t *Theme) H2(txt string) Label

func (*Theme) H3

func (t *Theme) H3(txt string) Label

func (*Theme) H4

func (t *Theme) H4(txt string) Label

func (*Theme) H5

func (t *Theme) H5(txt string) Label

func (*Theme) H6

func (t *Theme) H6(txt string) Label

func (*Theme) IconButton

func (t *Theme) IconButton(button *widget.Clickable, icon *widget.Icon) IconButton

func (*Theme) Image

func (t *Theme) Image(img paint.ImageOp) Image

func (*Theme) ImageIcon

func (t *Theme) ImageIcon(gtx layout.Context, icon image.Image, size int) layout.Dimensions

func (*Theme) Label

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

func (*Theme) Line

func (t *Theme) Line() *Line

Line returns a line widget instance

func (*Theme) Modal

func (t *Theme) Modal(title string) *Modal

func (*Theme) Outline

func (t *Theme) Outline() Outline

func (*Theme) Password

func (t *Theme) Password() *Password

Password initializes and returns an instance of Password

func (*Theme) PlainIconButton

func (t *Theme) PlainIconButton(button *widget.Clickable, icon *widget.Icon) IconButton

func (*Theme) ProgressBar

func (t *Theme) ProgressBar(progress int) ProgressBarStyle

func (*Theme) RadioButton

func (t *Theme) RadioButton(group *widget.Enum, key, label string) RadioButton

RadioButton returns a RadioButton with a label. The key specifies the value for the Enum.

func (*Theme) SuccessAlert

func (t *Theme) SuccessAlert(gtx layout.Context, txt string) layout.Dimensions

func (*Theme) Surface

func (t *Theme) Surface(gtx layout.Context, w layout.Widget) layout.Dimensions

Jump to

Keyboard shortcuts

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