widget

package
v0.0.0-...-311e29d Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildKeygroup

func BuildKeygroup(prefix string, keys ...string) string

BuildKeygroup builds a group of keys, e.g. Short-[C,V,X]. The prefix is optional. If there's only one key in the list, does not create a [] group.

This function is handy because you can mention individual letters ("C", "V", "X"), which makes it easier to search for them later.

func BuildKeyset

func BuildKeyset(groups ...string) string

BuildKeyset joins groups together with "|".

Types

type Activater

type Activater interface {
	Activate()
}

type C

type C = layout.Context

type D

type D = layout.Dimensions

type Deactivater

type Deactivater interface {
	Deactivate()
}

type Labeler

type Labeler interface {
	Label() string
}

type Layouter

type Layouter interface {
	Layout(C) D
}

type Tab

type Tab struct {
	Label        string
	W            Layouter
	Closeable    bool
	CloseButton  widget.Clickable
	BecameActive bool
	// contains filtered or unexported fields
}

func NewTab

func NewTab(label string, w Layouter, closeable bool) *Tab

func (*Tab) GetLabel

func (t *Tab) GetLabel() string

func (*Tab) Layout

func (t *Tab) Layout(gtx C) D

func (*Tab) LayoutButton

func (t *Tab) LayoutButton(gtx C, w layout.Widget) D

type TabEvent

type TabEvent struct {
	Type TabEventType
	Tab  Layouter
}

type TabEventType

type TabEventType int
const (
	TabEventClose TabEventType = iota
	TabEventActivate
)

type Tabbar

type Tabbar struct {
	Tabs []*Tab
	// contains filtered or unexported fields
}

func NewTabbar

func NewTabbar(tabs ...*Tab) *Tabbar

func (*Tabbar) Activate

func (tb *Tabbar) Activate(key interface{})

func (*Tabbar) Active

func (tb *Tabbar) Active() *Tab

func (*Tabbar) ActiveIndex

func (tb *Tabbar) ActiveIndex() int

func (*Tabbar) Append

func (tb *Tabbar) Append(t *Tab)

func (*Tabbar) Close

func (tb *Tabbar) Close(index int)

Close closes the indicated tab. You cannot close the active tab.

func (*Tabbar) Events

func (tb *Tabbar) Events(gtx layout.Context) []TabEvent

func (*Tabbar) IndexOf

func (tb *Tabbar) IndexOf(key interface{}) int

func (*Tabbar) Insert

func (tb *Tabbar) Insert(index int, t *Tab)

func (*Tabbar) InsertAfter

func (tb *Tabbar) InsertAfter(after, new *Tab)

func (*Tabbar) Next

func (tb *Tabbar) Next()

func (*Tabbar) Prev

func (tb *Tabbar) Prev()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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