gui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CardView

type CardView struct {
	*tview.Flex
	// contains filtered or unexported fields
}

CardView is a gui component in charge of displaying an open card and the list it belongs to

func NewCardView

func NewCardView(state store.CardState, handler cardInputHandler) *CardView

NewCardView returns an new instance of CardView

func (*CardView) Draw

func (c *CardView) Draw(screen tcell.Screen)

Draw re-implements the `tview.Primitive` interface Draw function

func (*CardView) FocusedItem

func (c *CardView) FocusedItem() tview.Primitive

FocusedItem returns the gui component currently in focus

func (*CardView) SetState

func (c *CardView) SetState(s store.CardState)

SetState updates the CardView component with the CardState

type Config

type Config struct {
	Dev bool // Enable developer features (recover on run panics)
}

Config is the gui configuration

type Gui

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

Gui is a graphical user interface for trello-tui

func NewGui

func NewGui(cfg *Config) *Gui

NewGui creates a new instance of `Gui` from the provide configuration

func (*Gui) Close

func (g *Gui) Close()

Close handles cleanup of the gui if required

func (*Gui) Init

func (g *Gui) Init(getState store.GetStateFunc) error

Init initializes the gui

func (*Gui) Run

func (g *Gui) Run() error

Run executes the gui and event loop

func (*Gui) SetFocus

func (g *Gui) SetFocus(p tview.Primitive)

SetFocus implements the focuser interface, allowing to set focus on the provided gui component

func (*Gui) Sync

func (g *Gui) Sync()

Sync updates the gui with the latest state

type Header struct {
	*tview.Box
	// contains filtered or unexported fields
}

Header is a gui component displaying the title and description of the current board

func NewHeader

func NewHeader(state store.HeaderState) *Header

NewHeader returns a new instance of Header

func (*Header) Draw

func (h *Header) Draw(screen tcell.Screen)

Draw re-implements the `tview.Primitive` interface Draw function

func (*Header) SetState

func (h *Header) SetState(state store.HeaderState)

SetState updates the Header componer with the HeaderState

type ListContainer

type ListContainer struct {
	*tview.Flex
	// contains filtered or unexported fields
}

ListContainer is a gui component in charge of displaying the board's lists

func NewListContainer

func NewListContainer(maxVLists int, state store.ListsState, f focuser, s switcher) *ListContainer

NewListContainer returns a new instance of ListContainer

func (*ListContainer) Draw

func (l *ListContainer) Draw(screen tcell.Screen)

Draw re-implements the `tview.Primitive` interface Draw function

func (*ListContainer) FocusedItem

func (l *ListContainer) FocusedItem() tview.Primitive

FocusedItem returns the currently focused list

func (*ListContainer) SetState

func (l *ListContainer) SetState(state store.ListsState)

SetState updates the ListContainer component with the ListState

type ListView

type ListView struct {
	*tview.Frame
	// contains filtered or unexported fields
}

ListView is a gui component in charge of displaying a single board list

func NewListView

func NewListView(parent listInputHandler, state store.SingleListState) *ListView

NewListView returns a new instance of ListView

func (*ListView) Draw

func (l *ListView) Draw(screen tcell.Screen)

Draw re-implements the `tview.Primitive` interface Draw function

func (*ListView) SetState

func (l *ListView) SetState(state store.SingleListState)

SetState updates the ListView component with the SingleListState

type View

type View struct {
	*tview.Flex
	// contains filtered or unexported fields
}

View is the root gui component

func NewView

func NewView(state store.ViewState, f focuser) *View

NewView returns a new instance of View

func (*View) FocusedItem

func (v *View) FocusedItem() tview.Primitive

FocusedItem returns the gui component currently in focus TODO: this is mainly necessary to ensure the focus is on the correct item at startup, this is not nice.

func (*View) SetState

func (v *View) SetState(s store.ViewState)

SetState updates the View with the ViewState

Jump to

Keyboard shortcuts

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