razgio

package module
v0.0.0-...-7dfc0f2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: MIT Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMessageBox

func NewMessageBox(th *material.Theme, message string, okFunc func()) layout.Widget

func NewYesNoMessageBox

func NewYesNoMessageBox(th *material.Theme, message string, yesNoFunc func(bool)) layout.Widget

Types

type ButtonBar

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

func NewButtonBar

func NewButtonBar(btns ...string) ButtonBar

func (*ButtonBar) Clicked

func (bb *ButtonBar) Clicked(idx int) bool

func (*ButtonBar) Layout

func (bb *ButtonBar) Layout(gtx C, th *material.Theme) D

func (*ButtonBar) SetButtonIcon

func (bb *ButtonBar) SetButtonIcon(idx int, icon *widget.Icon)

type C

type C = layout.Context

type D

type D = layout.Dimensions

type Dialog

type Dialog struct {
	Message string
	ButtonBar
	Width  unit.Value
	Height unit.Value
	Inset  unit.Value
}

func NewDialog

func NewDialog(message string, buttons ...string) Dialog

func (*Dialog) Layout

func (d *Dialog) Layout(gtx C, th *material.Theme) D

type IconAndTextButtonStyle

type IconAndTextButtonStyle struct {
	material.ButtonStyle
	Icon *widget.Icon
	// contains filtered or unexported fields
}

func IconAndTextButton

func IconAndTextButton(th *material.Theme, btn *widget.Clickable, icon *widget.Icon, text string) IconAndTextButtonStyle

func (IconAndTextButtonStyle) Layout

func (b IconAndTextButtonStyle) Layout(gtx C) D

type Icons

type Icons struct {
	ContentAdd            *widget.Icon
	ActionDelete          *widget.Icon
	CheckBoxBlank         *widget.Icon
	CheckBoxIndeterminate *widget.Icon
	ArrowLeft             *widget.Icon
	ArrowRight            *widget.Icon
	ArrowUp               *widget.Icon
	ArrowDown             *widget.Icon
}

func GetIcons

func GetIcons() *Icons

type ListWithScrollbar

type ListWithScrollbar struct {
	layout.List
	component.VisibilityAnimation
	FinalAlpha         int
	VisibilityDuration time.Duration
	// contains filtered or unexported fields
}

func NewListWithScrollbar

func NewListWithScrollbar() ListWithScrollbar

func (*ListWithScrollbar) FitsScreen

func (l *ListWithScrollbar) FitsScreen() bool

func (*ListWithScrollbar) Layout

func (l *ListWithScrollbar) Layout(gtx C, th *material.Theme, len int, w layout.ListElement) D

type MessageBox

type MessageBox struct {
	Dialog
	// contains filtered or unexported fields
}

func (*MessageBox) Layout

func (mbox *MessageBox) Layout(gtx C) D

type ModalHandler

type ModalHandler interface {
	ModalMessage(msg string)
	ModalYesNo(msg string, yes func())
}

type Page

type Page interface {
	GetName() string
	Select()
	Layout(gtx C) D
}

type PageHandler

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

func NewPageHandler

func NewPageHandler(th *material.Theme) *PageHandler

func (*PageHandler) AddPage

func (ph *PageHandler) AddPage(page Page) int

func (*PageHandler) Layout

func (ph *PageHandler) Layout(gtx C) D

func (*PageHandler) ModalMessage

func (ph *PageHandler) ModalMessage(msg string)

func (*PageHandler) ModalYesNo

func (ph *PageHandler) ModalYesNo(msg string, yesFunc func())

func (*PageHandler) SwitchToPage

func (ph *PageHandler) SwitchToPage(idx int)

type RichTextCheckBoxStyle

type RichTextCheckBoxStyle struct {
	CheckBox *widget.Bool
	// contains filtered or unexported fields
}

func RichTextCheckBox

func RichTextCheckBox(th *material.Theme, checkBox *widget.Bool, label ...richtext.SpanStyle) RichTextCheckBoxStyle

func (RichTextCheckBoxStyle) Layout

type Slider

type Slider struct {
	Duration time.Duration
	// contains filtered or unexported fields
}

Slider implements sliding between old/new widget values.

func (*Slider) Layout

func (s *Slider) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions

Layout lays out widget that can be pushed.

func (*Slider) PushLeft

func (s *Slider) PushLeft()

PushLeft pushes the existing widget to the left.

func (*Slider) PushRight

func (s *Slider) PushRight()

PushRight pushes the existing widget to the right.

type Tabs

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

func NewTabs

func NewTabs(th *material.Theme) *Tabs

func (*Tabs) AddTab

func (tabs *Tabs) AddTab(title string, content layout.Widget) int

func (*Tabs) Layout

func (tabs *Tabs) Layout(gtx C) D

func (*Tabs) SetSelectFunc

func (tabs *Tabs) SetSelectFunc(onSelect func(int))

func (*Tabs) SwitchToTab

func (tabs *Tabs) SwitchToTab(tabIdx int)

type TextField

type TextField struct {
	// Editor contains the edit buffer.
	widget.Editor
	// Hoverable detects mouse hovers.
	Hoverable component.Hoverable
	// Alignment specifies where to anchor the text.
	Alignment layout.Alignment

	// Helper text to give additional context to a field.
	Helper string
	// CharLimit specifies the maximum number of characters the text input
	// will allow. Zero means "no limit".
	CharLimit uint
	// Prefix appears before the content of the text input.
	Prefix layout.Widget
	// Suffix appears after the content of the text input.
	Suffix layout.Widget
	// contains filtered or unexported fields
}

TextField implements the Material Design Text Field described here: https://material.io/components/text-fields

func (*TextField) Clear

func (in *TextField) Clear()

Clear the input text and reset any error status.

func (*TextField) ClearError

func (in *TextField) ClearError()

ClearError clears any errored status.

func (TextField) IsActive

func (in TextField) IsActive() bool

IsActive if input is in an active state (Active, Focused or Errored).

func (*TextField) IsErrored

func (in *TextField) IsErrored() bool

IsErrored if input is in an errored state. Typically this is when the validator has returned an error message.

func (*TextField) Layout

func (in *TextField) Layout(gtx C, th *material.Theme, label, hint string) D

func (*TextField) SetError

func (in *TextField) SetError(err string)

SetError puts the input into an errored state with the specified error text.

func (*TextField) TextTooLong

func (in *TextField) TextTooLong() bool

TextTooLong returns whether the current editor text exceeds the set character limit.

func (*TextField) Update

func (in *TextField) Update(gtx C, th *material.Theme, label string)

type Tree

type Tree struct {
	widget.Bool
	Label    []TreeLabel
	Children []*Tree
}

func NewTree

func NewTree(label ...TreeLabel) Tree

func (*Tree) AddChild

func (tree *Tree) AddChild(label ...TreeLabel) *Tree

func (*Tree) ClearChildren

func (tree *Tree) ClearChildren()

func (*Tree) Layout

func (tree *Tree) Layout(gtx C, th *material.Theme) D

type TreeLabel

type TreeLabel struct {
	Text      string
	Highlight bool
}

type Validator

type Validator = func(string) string

Validator validates text and returns a string describing the error. Error is displayed as helper text.

type YesNoMessageBox

type YesNoMessageBox struct {
	Dialog
	// contains filtered or unexported fields
}

func (*YesNoMessageBox) Layout

func (mbox *YesNoMessageBox) Layout(gtx C) D

Jump to

Keyboard shortcuts

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