navi

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: MIT Imports: 22 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 NavDrawer struct {

	// used to set inset of each section.
	SectionInset layout.Inset
	// contains filtered or unexported fields
}

func NewNavDrawer

func NewNavDrawer(vm view.ViewManager) *NavDrawer
func (nv *NavDrawer) AddSection(item NavSection)
func (nv *NavDrawer) InsertAt(index int, item NavSection)
func (nv *NavDrawer) Layout(gtx C, th *theme.Theme) D
func (nv *NavDrawer) OnItemSelected(gtx C, item *NavItemStyle)
func (nv *NavDrawer) RemoveSection(index int)
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(gtx layout.Context) ([][]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, openAsModal bool) 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, 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 {
	Height            unit.Dp
	MaxVisibleActions int
}

Jump to

Keyboard shortcuts

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