navi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

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)

type C

type C = layout.Context

type D

type D = layout.Dimensions
type NavDrawer struct {
	// contains filtered or unexported fields
}

func NewNavDrawer

func NewNavDrawer(vm view.ViewManager) *NavDrawer
func (nv *NavDrawer) AddSection(item NavSection)
func (nv *NavDrawer) Layout(gtx C, th *theme.Theme) D
func (nv *NavDrawer) OnItemSelected(gtx C, item *NavItemStyle)
type NavItem interface {
	OnSelect(gtx layout.Context) view.Intent
	Icon() *widget.Icon
	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. NavItemStyle should place a clickable icon to guide user interactions.
	ContextMenuOptions() ([][]menu.MenuOption, bool)
	Children() []NavItem
}
type NavItemStyle struct {
	// contains filtered or unexported fields
}

func NewNavItem

func NewNavItem(item NavItem, drawer *NavDrawer) *NavItemStyle
func (n *NavItemStyle) IsSelected() bool
func (n *NavItemStyle) Layout(gtx C, th *theme.Theme) D
func (n *NavItemStyle) Unselect()
func (n *NavItemStyle) Update(gtx C) bool
type NavSection interface {
	Title() string
	Layout(gtx C, th *theme.Theme) D
	Attach(d *NavDrawer)
}

func SimpleItemSection

func SimpleItemSection(icon *widget.Icon, name string, targetView view.ViewID) NavSection
type NaviDrawerStyle struct {
	*NavDrawer
	Inset layout.Inset
	Bg    color.NRGBA
	Width unit.Dp
}
func (ns NaviDrawerStyle) Layout(gtx C, th *theme.Theme) D

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) *Tabbar

func (*Tabbar) Layout

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

Jump to

Keyboard shortcuts

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