list

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type C

type C = layout.Context

type D

type D = layout.Dimensions

type InteractiveLabel

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

func (*InteractiveLabel) IsSelected

func (l *InteractiveLabel) IsSelected() bool

func (*InteractiveLabel) Layout

func (l *InteractiveLabel) Layout(gtx C, th *theme.Theme, w func(gtx C, textColor color.NRGBA) D) D

func (*InteractiveLabel) Select added in v0.6.0

func (l *InteractiveLabel) Select()

func (*InteractiveLabel) Unselect

func (l *InteractiveLabel) Unselect()

func (*InteractiveLabel) Update

func (l *InteractiveLabel) Update(gtx layout.Context) bool

follow the new Update API to handle events before layout in the current frame.

type ListContent

type ListContent interface {
	SetSelected(selected bool)
	// text should be rendered using contentColor
	Layout(gtx layout.Context, th *theme.Theme, contentColor color.NRGBA) layout.Dimensions
}

type ListItem

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

func (*ListItem) GetContent

func (li *ListItem) GetContent() ListContent

func (*ListItem) Layout

func (li *ListItem) Layout(gtx layout.Context, th *theme.Theme) layout.Dimensions

func (*ListItem) Update

func (li *ListItem) Update(gtx layout.Context) bool

type SelectableList

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

func NewSelectableList

func NewSelectableList(contents []ListContent) *SelectableList

func (*SelectableList) Layout

func (sl *SelectableList) Layout(gtx layout.Context, th *theme.Theme) layout.Dimensions

func (*SelectableList) SelectedItem

func (sl *SelectableList) SelectedItem() *ListItem

func (*SelectableList) SelectionChanged

func (sl *SelectableList) SelectionChanged(gtx C) bool

func (*SelectableList) Update

func (sl *SelectableList) Update(gtx C) bool

return whether current selected item is clicked.

func (*SelectableList) UpdateListItems

func (sl *SelectableList) UpdateListItems(contents []ListContent)

Jump to

Keyboard shortcuts

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