Documentation ¶
Index ¶
- Constants
- func AddList(gui *Gui, list trello.List, index, offset int) error
- func SelectedItemIdx(view *View) int
- func SetKeyBindings(gui *Gui, mngr *TregoManager) (err error)
- type CardEditor
- type InfoBar
- type ShortcutsBar
- type TregoManager
- func (mngr *TregoManager) CheckCurrView(gui *gocui.Gui, replacementViewName string)
- func (mngr *TregoManager) Layout(gui *Gui) error
- func (mngr *TregoManager) SelectView(gui *gocui.Gui, viewName string) error
- func (mngr *TregoManager) SwitchListLeft(gui *gocui.Gui, v *gocui.View) (err error)
- func (mngr *TregoManager) SwitchListRight(gui *gocui.Gui, v *gocui.View) (err error)
Constants ¶
View Source
const ( BottomBar string = "botbar" TopBar string = "topbar" SearchView string = "searchview" ListWidth int = 24 )
Variables ¶
This section is empty.
Functions ¶
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 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 (*TregoManager) SwitchListRight ¶
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. |
Click to show internal directories.
Click to hide internal directories.