widget

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success string = "success"
	Info    string = "info"
	Warn    string = "warn"
	Error   string = "error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type C

type C = layout.Context

type D

type D = layout.Dimensions

type Dialog

type Dialog struct {
	Title   i18n.Key
	Body    i18n.Key
	Widget  func(gtx layout.Context, th *material.Theme) layout.Dimensions
	OnClick func(ok bool)
	// contains filtered or unexported fields
}

func (*Dialog) Layout

func (p *Dialog) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions

type InputDialog

type InputDialog struct {
	Title   i18n.Key
	Body    i18n.Key
	Hint    i18n.Key
	Input   component.TextField
	OnClick func(ok bool)
	// contains filtered or unexported fields
}

func (*InputDialog) Layout

type Menu struct {
	Title   i18n.Key
	Options []MenuOption
	OnClick func(ok bool)

	OnAdd    func()
	Multiple bool
	// contains filtered or unexported fields
}
func (p *Menu) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions
type MenuOption struct {
	Key      i18n.Key
	Name     string
	Value    string
	DescKey  i18n.Key
	Desc     string
	Selected bool
	// contains filtered or unexported fields
}
func (p *MenuOption) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions

type Message

type Message struct {
	Type    string
	Content string
}

type MetadataDialog

type MetadataDialog struct {
	K       component.TextField
	V       component.TextField
	OnClick func(ok bool)
	// contains filtered or unexported fields
}

func (*MetadataDialog) Layout

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

func NewNav

func NewNav(btns ...*NavButton) *Nav
func (p *Nav) Current() int
func (p *Nav) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions
func (p *Nav) SetCurrent(n int)
type NavButton struct {
	// contains filtered or unexported fields
}

func NewNavButton

func NewNavButton(text i18n.Key) *NavButton
func (btn *NavButton) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions

type Notification

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

func NewNotification

func NewNotification(d time.Duration, callback func()) *Notification

func (*Notification) Layout

func (p *Notification) Layout(gtx C, th *T) D

func (*Notification) Show

func (p *Notification) Show(message Message)

type Selector

type Selector struct {
	Title i18n.Key
	// contains filtered or unexported fields
}

func (*Selector) Any

func (p *Selector) Any(items ...SelectorItem) bool

func (*Selector) AnyValue

func (p *Selector) AnyValue(values ...string) bool

func (*Selector) Clear

func (p *Selector) Clear()

func (*Selector) Clicked

func (p *Selector) Clicked(gtx layout.Context) bool

func (*Selector) Item

func (p *Selector) Item() SelectorItem

func (*Selector) Items

func (p *Selector) Items() []SelectorItem

func (*Selector) Layout

func (p *Selector) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions

func (*Selector) Select

func (p *Selector) Select(items ...SelectorItem)

func (*Selector) Value

func (p *Selector) Value() string

func (*Selector) Values

func (p *Selector) Values() (values []string)

type SelectorItem

type SelectorItem struct {
	Name  string
	Key   i18n.Key
	Value string
}

type Switcher

type Switcher struct {
	Title i18n.Key
	// contains filtered or unexported fields
}

func (*Switcher) Layout

func (p *Switcher) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions

func (*Switcher) SetValue

func (p *Switcher) SetValue(b bool)

func (*Switcher) Value

func (p *Switcher) Value() bool

type T

type T = material.Theme

type Widget

type Widget interface {
	Layout(gtx C, th *T) D
}

Jump to

Keyboard shortcuts

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