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

func Disabled

func Disabled(c color.NRGBA) (d color.NRGBA)

    Disabled blends color towards the luminance and multiplies alpha. Blending towards luminance will desaturate the color. Multiplying alpha blends the color together more with the background.

    func Fill

    func Fill(gtx layout.Context, col color.NRGBA) layout.Dimensions

    Types

    type Badge

    type Badge struct {
    	Background color.NRGBA
    }

    func (*Badge) Layout

    func (b *Badge) Layout(gtx C, label Label) D

    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.NRGBA
    	Radius CornerRadius
    }

    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 {
      	BackgroundColor color.NRGBA
      	// contains filtered or unexported fields
      }

      func (*Collapsible) Layout

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

      type CollapsibleWithOption

      type CollapsibleWithOption struct {
      	BackgroundColor color.NRGBA
      	// contains filtered or unexported fields
      }

      func (*CollapsibleWithOption) Layout

      func (c *CollapsibleWithOption) Layout(gtx layout.Context, header, body func(C) D, more func(C)) layout.Dimensions

      func (*CollapsibleWithOption) MoreTriggered

      func (c *CollapsibleWithOption) MoreTriggered() bool

      type CornerRadius

      type CornerRadius struct {
      	NE float32
      	NW float32
      	SE float32
      	SW float32
      }

      type D

      type D = layout.Dimensions
      type DropDown struct {
      	// contains filtered or unexported fields
      }
      func (c *DropDown) Changed() bool
      func (c *DropDown) Layout(gtx layout.Context) layout.Dimensions
      func (c *DropDown) Selected() string
      func (c *DropDown) SelectedIndex() int
      type DropDownItem struct {
      	Text string
      	Icon image.Image
      	// contains filtered or unexported fields
      }

      type Editor

      type Editor struct {
      	material.EditorStyle
      
      	TitleLabel Label
      
      	LineColor       color.NRGBA
      	TitleLabelColor color.NRGBA
      
      	//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.
      	IsCustomButton bool
      	CustomButton   Button
      
      	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(text string)

      func (*Editor) SetRequiredErrorText

      func (e *Editor) SetRequiredErrorText(txt string)

      type Float

      type Float struct {
      	Value float32
      	// contains filtered or unexported fields
      }

        Float is for selecting a value in a range.

        func (*Float) Changed

        func (f *Float) Changed() bool

          Changed reports whether the value has changed since the last call to Changed.

          func (*Float) Layout

          func (f *Float) Layout(gtx layout.Context, pointerMargin, contentLength int) layout.Dimensions

            Layout processes events.

            func (*Float) Pos

            func (f *Float) Pos() float32

              Pos reports the selected position.

              func (*Float) Scrolled

              func (f *Float) Scrolled() bool

              type Grid

              type Grid struct {
              	Num       int
              	Axis      layout.Axis
              	Alignment layout.Alignment
              	// contains filtered or unexported fields
              }

                Grid lays out at most Num elements along the main axis. The number of cross axis elements depend on the total number of elements.

                func (*Grid) Layout

                func (g *Grid) Layout(gtx layout.Context, num int, el GridElement) layout.Dimensions

                type GridElement

                type GridElement func(gtx layout.Context, i int) layout.Dimensions

                  GridElement lays out the ith element of a Grid.

                  type GridWrap

                  type GridWrap struct {
                  	Axis      layout.Axis
                  	Alignment layout.Alignment
                  }

                    GridWrap lays out as many elements as possible along the main axis before wrapping to the cross axis.

                    func (GridWrap) Layout

                    func (g GridWrap) Layout(gtx layout.Context, num int, el GridElement) layout.Dimensions

                    type Hoverable

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

                    func (*Hoverable) Hovered

                    func (h *Hoverable) Hovered() bool

                    func (*Hoverable) Layout

                    func (h *Hoverable) Layout(gtx C, rect image.Rectangle) D

                    func (*Hoverable) Position

                    func (h *Hoverable) Position() *f32.Point

                    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 Label

                      type Label struct {
                      	material.LabelStyle
                      }

                      type Line

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

                        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.

                            type Outline

                            type Outline struct {
                            	BorderColor color.NRGBA
                            	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

                              func (*Password) WithError

                              func (p *Password) WithError(e string)

                              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 {
                                	Radius unit.Value
                                	Height unit.Value
                                	material.ProgressBarStyle
                                }

                                func (ProgressBarStyle) Layout

                                type RadioButton

                                type RadioButton struct {
                                	material.RadioButtonStyle
                                }

                                type ReadClipboard

                                type ReadClipboard struct{}

                                type ScrollContainer

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

                                func (*ScrollContainer) Layout

                                func (s *ScrollContainer) Layout(gtx layout.Context, widgets []func(gtx C) D) layout.Dimensions

                                type Scrollbar

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

                                func (*Scrollbar) Layout

                                func (s *Scrollbar) Layout(gtx layout.Context, contentLength, initialPosition float32) layout.Dimensions

                                func (*Scrollbar) Position

                                func (s *Scrollbar) Position() float32

                                type Shadow

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

                                func (*Shadow) Layout

                                func (s *Shadow) Layout(gtx C, w layout.Widget) D

                                type Switch

                                type Switch struct {
                                	material.SwitchStyle
                                }

                                type SwitchButtonText

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

                                func (*SwitchButtonText) Layout

                                func (*SwitchButtonText) SelectedOption

                                func (s *SwitchButtonText) SelectedOption() string

                                type SwitchItem

                                type SwitchItem struct {
                                	Text string
                                	// contains filtered or unexported fields
                                }

                                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 TextAndIconButton

                                            type TextAndIconButton struct {
                                            	Button *widget.Clickable
                                            
                                            	Color           color.NRGBA
                                            	BackgroundColor color.NRGBA
                                            	// contains filtered or unexported fields
                                            }

                                            func (TextAndIconButton) Layout

                                            type Theme

                                            type Theme struct {
                                            	Shaper text.Shaper
                                            	Base   *material.Theme
                                            	Color  struct {
                                            		Primary      color.NRGBA
                                            		Secondary    color.NRGBA
                                            		Text         color.NRGBA
                                            		Hint         color.NRGBA
                                            		Overlay      color.NRGBA
                                            		InvText      color.NRGBA
                                            		Success      color.NRGBA
                                            		Danger       color.NRGBA
                                            		Background   color.NRGBA
                                            		Surface      color.NRGBA
                                            		Gray         color.NRGBA
                                            		Black        color.NRGBA
                                            		DeepBlue     color.NRGBA
                                            		LightGray    color.NRGBA
                                            		InactiveGray color.NRGBA
                                            		Gray1        color.NRGBA
                                            		Gray2        color.NRGBA
                                            		Gray3        color.NRGBA
                                            	}
                                            	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, decredIcons map[string]image.Image) *Theme

                                            func (*Theme) Background

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

                                            func (*Theme) Badge

                                            func (t *Theme) Badge() *Badge

                                            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) Card

                                            func (t *Theme) Card() Card

                                            func (*Theme) CheckBox

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

                                            func (*Theme) Collapsible

                                            func (t *Theme) Collapsible() *Collapsible

                                            func (*Theme) CollapsibleWithOption

                                            func (t *Theme) CollapsibleWithOption() *CollapsibleWithOption

                                            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) DropDown

                                              func (t *Theme) DropDown(items []DropDownItem, group uint) *DropDown

                                              func (*Theme) Editor

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

                                              func (*Theme) EditorPassword

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

                                              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) Hoverable

                                              func (t *Theme) Hoverable() *Hoverable

                                              func (*Theme) IconButton

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

                                              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(height, width int) Line

                                                Line returns a line widget instance

                                                func (*Theme) Modal

                                                func (t *Theme) Modal() *Modal

                                                func (*Theme) ModalFloatTitle

                                                func (t *Theme) ModalFloatTitle() *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) ScrollContainer

                                                    func (t *Theme) ScrollContainer() *ScrollContainer

                                                    func (*Theme) Scrollbar

                                                    func (t *Theme) Scrollbar(float *Float, min, max float32) Scrollbar

                                                    func (*Theme) Separator

                                                    func (t *Theme) Separator() Line

                                                    func (*Theme) Shadow

                                                    func (t *Theme) Shadow() *Shadow

                                                    func (*Theme) Surface

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

                                                    func (*Theme) Switch

                                                    func (t *Theme) Switch(swtch *widget.Bool) Switch

                                                    func (*Theme) SwitchButtonText

                                                    func (t *Theme) SwitchButtonText(i []SwitchItem) *SwitchButtonText

                                                    func (*Theme) TextAndIconButton

                                                    func (t *Theme) TextAndIconButton(btn *widget.Clickable, text string, icon *widget.Icon) TextAndIconButton

                                                    func (*Theme) Tooltip

                                                    func (t *Theme) Tooltip() *Tooltip

                                                    func (*Theme) VoteBar

                                                    func (t *Theme) VoteBar(infoIcon, legendIcon *widget.Icon) VoteBar

                                                    type Tooltip

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

                                                    func (*Tooltip) Layout

                                                    func (t *Tooltip) Layout(gtx C, rect image.Rectangle, pos layout.Inset, wdgt func(gtx C) D) D

                                                    type VoteBar

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

                                                      VoteBar widget implements voting stat for proposals. VoteBar shows the range/percentage of the yes votes and no votes against the total required.

                                                      func (*VoteBar) Layout

                                                      func (v *VoteBar) Layout(gtx C) D

                                                      func (*VoteBar) LayoutWithLegend

                                                      func (v *VoteBar) LayoutWithLegend(gtx C) D

                                                      func (*VoteBar) SetParams

                                                      func (v *VoteBar) SetParams(yesVotes, noVotes, eligibleVotes, requiredPercentage, passPercentage float32) *VoteBar