ui

package
v0.0.0-...-ab63aab Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2017 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BottomBar  string = "botbar"
	TopBar     string = "topbar"
	SearchView string = "searchview"
	ListWidth  int    = 24
)

Variables

This section is empty.

Functions

func AddList

func AddList(gui *Gui, list trello.List, index, offset int) error

func SelectedItemIdx

func SelectedItemIdx(view *View) int

func SetKeyBindings

func SetKeyBindings(gui *Gui, mngr *TregoManager) (err error)

Types

type CardEditor

type CardEditor struct {
	Mngr *TregoManager
	Card *trello.Card
	// contains filtered or unexported fields
}

func (*CardEditor) Layout

func (cEdit *CardEditor) Layout(gui *Gui) error

type InfoBar

type InfoBar struct {
	BoardName string
}

func (*InfoBar) Layout

func (iBar *InfoBar) Layout(gui *Gui) error

type ShortcutsBar

type ShortcutsBar struct {
	DefaultBotBarKey string                `json:"default_bottom_bar_key"`
	Data             map[string][][]string `json:"bottom_bar"`

	CurrBotBarKey string
}

func (*ShortcutsBar) Layout

func (botBar *ShortcutsBar) Layout(gui *Gui) error

bottom bar with shortcuts

type TregoManager

type TregoManager struct {
	Member    *trello.Member
	Lists     []trello.List
	CurrBoard *trello.Board

	TopBar *InfoBar
	BotBar *ShortcutsBar
	// contains filtered or unexported fields
}

func (*TregoManager) CheckCurrView

func (mngr *TregoManager) CheckCurrView(gui *gocui.Gui, replacementViewName string)

func (*TregoManager) Layout

func (mngr *TregoManager) Layout(gui *Gui) error

func (*TregoManager) SelectView

func (mngr *TregoManager) SelectView(gui *gocui.Gui, viewName string) error

func (*TregoManager) SwitchListLeft

func (mngr *TregoManager) SwitchListLeft(gui *gocui.Gui, v *gocui.View) (err error)

func (*TregoManager) SwitchListRight

func (mngr *TregoManager) SwitchListRight(gui *gocui.Gui, v *gocui.View) (err error)

Directories

Path Synopsis
Package that contains variety of dialogs Example of using InputDialog input := make(chan string) //Prevents nested dialogs and other glitches (like double handler call) for _, view := range gui.Views() { gui.DeleteKeybindings(view.Name()) } utils.ErrCheck( mngr.SelectView( gui, dialog.InputDialog("Are you sure? [y/n]", "", "", gui, input).Name())) go func() { if userInput, ok := <-input; ok { log.Print(userInput) } SetKeyBindings(gui, mngr) }() Similar example for ConfirmDialog option := make(chan bool) previousView := gui.CurrentView() log.Println("callback: ", previousView.Name()) //Prevents nested dialogs and other glitches (like double handler call) for _, view := range gui.Views() { gui.DeleteKeybindings(view.Name()) } utils.ErrCheck( mngr.SelectView( gui, dialog.ConfirmDialog("message", "title", gui, option).Name())) go func() { if choice, ok = <-option; ok { log.Printf("Choosen option: %v", choice) } mngr.currView = previousView log.Println("thread: ", mngr.currView.Name(), previousView.Name()) SetKeyBindings(gui, mngr) }() Remember! When user chooses an option, it deletes returned view, so make sure to handle it properly.
Package that contains variety of dialogs Example of using InputDialog input := make(chan string) //Prevents nested dialogs and other glitches (like double handler call) for _, view := range gui.Views() { gui.DeleteKeybindings(view.Name()) } utils.ErrCheck( mngr.SelectView( gui, dialog.InputDialog("Are you sure? [y/n]", "", "", gui, input).Name())) go func() { if userInput, ok := <-input; ok { log.Print(userInput) } SetKeyBindings(gui, mngr) }() Similar example for ConfirmDialog option := make(chan bool) previousView := gui.CurrentView() log.Println("callback: ", previousView.Name()) //Prevents nested dialogs and other glitches (like double handler call) for _, view := range gui.Views() { gui.DeleteKeybindings(view.Name()) } utils.ErrCheck( mngr.SelectView( gui, dialog.ConfirmDialog("message", "title", gui, option).Name())) go func() { if choice, ok = <-option; ok { log.Printf("Choosen option: %v", choice) } mngr.currView = previousView log.Println("thread: ", mngr.currView.Name(), previousView.Name()) SetKeyBindings(gui, mngr) }() Remember! When user chooses an option, it deletes returned view, so make sure to handle it properly.

Jump to

Keyboard shortcuts

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