sidebar

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAlpha

func WithAlpha(c color.NRGBA, a uint8) color.NRGBA

WithAlpha returns the input color with the new alpha value.

Types

type AlphaPalette

type AlphaPalette struct {
	Hover, Selected uint8
}

type C

type C = layout.Context

type D

type D = layout.Dimensions

type Item

type Item struct {
	Tag  any
	Name string
	Icon *widget.Icon
}

type Rect

type Rect struct {
	Color color.NRGBA
	Size  image.Point
	Radii int
}

func (Rect) Layout

func (r Rect) Layout(gtx C) D
type Sidebar struct {
	AlphaPalette
	// contains filtered or unexported fields
}

func New

func New() *Sidebar

func (*Sidebar) AddNavItem

func (s *Sidebar) AddNavItem(item Item)

AddNavItem inserts a navigation target into the drawer. This should be invoked only from the layout thread to avoid nasty race conditions.

func (*Sidebar) Changed

func (s *Sidebar) Changed() bool

func (*Sidebar) Current

func (s *Sidebar) Current() interface{}

func (*Sidebar) Layout

func (s *Sidebar) Layout(gtx layout.Context, th *chapartheme.Theme) layout.Dimensions

func (*Sidebar) LayoutContents

func (s *Sidebar) LayoutContents(gtx layout.Context, th *chapartheme.Theme) layout.Dimensions

func (*Sidebar) SetSelected

func (s *Sidebar) SetSelected(tag interface{})

Jump to

Keyboard shortcuts

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