navi

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TabSelectedEvent = TabEvent("TabSelected")
	TabClosedEvent   = TabEvent("TabClosed")
)

Variables

View Source
var NavItemPadding = layout.Inset{
	Left:   unit.Dp(4),
	Right:  unit.Dp(4),
	Top:    unit.Dp(1),
	Bottom: unit.Dp(1),
}

Functions

This section is empty.

Types

type ActionBar

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

func (*ActionBar) Layout

func (ab *ActionBar) Layout(gtx layout.Context, th *theme.Theme) layout.Dimensions

func (*ActionBar) SetActions

func (ab *ActionBar) SetActions(actions []view.ViewAction, maxVisibleActions int)

type C

type C = layout.Context

type D

type D = layout.Dimensions
type NavItem interface {
	Layout(gtx layout.Context, th *theme.Theme, textColor color.NRGBA) D
	// when there's menu options, a context menu should be attached to this navItem.
	// The returned boolean value suggest the position of the popup menu should be at
	// fixed position or not. NavTree should place a clickable icon to guide user interactions.
	ContextMenuOptions(gtx layout.Context) ([][]menu.MenuOption, bool)
	// Children returns children of the item, and a boolean value indicating wether children have changed.
	Children() ([]NavItem, bool)
}
type NavTree struct {
	OnClicked func(item *NavTree)
	// contains filtered or unexported fields
}

func NewNavItem

func NewNavItem(item NavItem, onClicked func(item *NavTree)) *NavTree
func (n *NavTree) IsSelected() bool
func (n *NavTree) Layout(gtx C, th *theme.Theme) D
func (n *NavTree) Unselect()
func (n *NavTree) Update(gtx C) bool

type Tab

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

func (*Tab) IsSelected

func (tab *Tab) IsSelected() bool

func (*Tab) Layout

func (tab *Tab) Layout(gtx C, th *theme.Theme) D

func (*Tab) Update

func (tab *Tab) Update(gtx C) []TabEvent

type TabEvent

type TabEvent string

type Tabbar

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

func NewTabbar

func NewTabbar(vm view.ViewManager, options *TabbarOptions) *Tabbar

func (*Tabbar) Layout

func (tb *Tabbar) Layout(gtx C, th *theme.Theme) D

type TabbarOptions added in v0.4.0

type TabbarOptions struct {
	MaxTabWidth       unit.Dp
	Height            unit.Dp
	MaxVisibleActions int
}

Jump to

Keyboard shortcuts

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