common

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SelectedCallback

type SelectedCallback func(int)

SelectedCallback for handler to handle the selected item

type TargetList

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

TargetList common view for add-ons

func NewTargetList

func NewTargetList(selectedCb SelectedCallback, opt *TargetListOpt) *TargetList

NewTargetList new a target list instance

func (*TargetList) CurrentSelected

func (tl *TargetList) CurrentSelected() int

CurrentSelected return current selected target ID

func (*TargetList) Init

func (tl *TargetList) Init(height int)

Init init list

func (*TargetList) OnDown

func (tl *TargetList) OnDown()

OnDown see `VerticalDirectionAware`

func (*TargetList) OnEnter

func (tl *TargetList) OnEnter()

OnEnter see `ConfirmAware`

func (*TargetList) OnUp

func (tl *TargetList) OnUp()

OnUp see `VerticalDirectionAware`

func (*TargetList) Render

func (tl *TargetList) Render() termui.GridBufferer

Render list render

func (*TargetList) UpdateState

func (tl *TargetList) UpdateState(targets []string, actives map[int]bool)

UpdateState of the target list component

type TargetListOpt

type TargetListOpt struct {
	// SelectOnMove no need to extra confirm
	SelectOnMove bool

	// InitSelected initial selected id
	InitSelected int

	// CallBackImmediate after init
	CallBackImmediate bool
}

TargetListOpt for target list

Jump to

Keyboard shortcuts

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