Documentation ¶
Index ¶
- func NewCommitList(ui *UI) (chan<- model.Annotation, gocui.Manager)
- func NewContributorsList(ui *UI) (chan<- model.Annotation, gocui.Manager)
- func NewItemDetails(ui *UI) (chan<- *work.FetchedItem, gocui.Manager)
- func NewItemsList(ui *UI) (chan<- model.Annotation, <-chan *work.FetchedItem, gocui.Manager)
- func NewList(ui *UI) (*list, chan *Selected)
- func NewSourceCodeList(ui *UI) (chan<- *model.File, <-chan *model.Line, gocui.Manager)
- func ToBinding(f func()) func(g *gocui.Gui, v *gocui.View) error
- func ToKeyString(key interface{}) (string, error)
- type CommitItems
- type ContributorItems
- type EmptyItems
- type FileItems
- type Focusable
- type HelpDocumenter
- type Items
- type Selected
- type SelectionEvent
- type UI
- func (u *UI) AddGlobalKey(key interface{}, description string, handler func())
- func (u *UI) AddLocalKey(key interface{}, description string, handler func())
- func (u *UI) AddOneUseGlobalKey(key interface{}, handler func())
- func (u *UI) CanFocus() bool
- func (u *UI) Focus()
- func (u *UI) IsFocused() bool
- func (u UI) Layout(g *gocui.Gui) error
- func (u *UI) PrintHelp(writer io.Writer)
- func (u *UI) Show() func()
- func (u *UI) Title(title string)
- func (u *UI) Update(f func(v *gocui.View))
- type WorkItems
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommitList ¶
func NewCommitList(ui *UI) (chan<- model.Annotation, gocui.Manager)
func NewContributorsList ¶
func NewContributorsList(ui *UI) (chan<- model.Annotation, gocui.Manager)
func NewItemDetails ¶
func NewItemDetails(ui *UI) (chan<- *work.FetchedItem, gocui.Manager)
func NewItemsList ¶
func NewItemsList(ui *UI) (chan<- model.Annotation, <-chan *work.FetchedItem, gocui.Manager)
func NewSourceCodeList ¶
func ToBinding ¶
ToBinding is a convenience method used to create keybinding methods from plain methods. This allows users to ignore details of the underlying cui framework
func ToKeyString ¶
ToKeyString converts a key to it's string representation
Types ¶
type CommitItems ¶
func (CommitItems) Display ¶
func (c CommitItems) Display(writer io.Writer)
func (CommitItems) Len ¶
func (c CommitItems) Len() int
type ContributorItems ¶
type ContributorItems []*git.Contributor
func (ContributorItems) Display ¶
func (c ContributorItems) Display(writer io.Writer)
func (ContributorItems) Len ¶
func (c ContributorItems) Len() int
type EmptyItems ¶
type EmptyItems struct{}
func (*EmptyItems) Display ¶
func (e *EmptyItems) Display(w io.Writer)
func (*EmptyItems) Len ¶
func (e *EmptyItems) Len() int
type Focusable ¶
type Focusable interface { // Focus ensures the ui is updated to show that this widget is focused. // Focused widgets will also receive key events. If a widget isn't focused local key event handlers will not fire. Focus() // CanFocus will return true when a widget can be focused, false otherwise. CanFocus() bool // IsFocused will return true if the widget is currently focused, false otherwise. IsFocused() bool }
Focusable allows callers to work with ui widgets that can be focused
type HelpDocumenter ¶
type HelpDocumenter interface { // PrintHelp prints help information for this widget PrintHelp(writer io.Writer) }
HelpDocumenter allows callers to ask ui widgets to give help about their functionality.
type Selected ¶
type Selected struct { Type SelectionEvent Index int Items Items }
type UI ¶
type UI struct { Name string Startx float64 Starty float64 Endx float64 Endy float64 Gui *gocui.Gui FocusOn interface{} // contains filtered or unexported fields }
UI is the base cui widget that all other ui widgets should extend
func (*UI) AddGlobalKey ¶
AddGlobalKey will add a key binding for the entire app. It will respond no matter which widget is focused
func (*UI) AddLocalKey ¶
AddLocalKey will add a key binding for this widget only. No other widgets will respond to this key's event handler
func (*UI) AddOneUseGlobalKey ¶
func (u *UI) AddOneUseGlobalKey(key interface{}, handler func())
AddOneUseGlobalKey will add a global key binding that will only work the first time the key is pressed. As soon as the key handler executes the key binding is removed.
func (*UI) Focus ¶
func (u *UI) Focus()
Focus ensures the ui is updated to show that this widget is focused. Focused widgets will also receive key events. If a widget isn't focused local key event handlers will not fire.
func (*UI) IsFocused ¶
IsFocused will return true if the widget is currently focused, false otherwise.
func (UI) Layout ¶
Layout positions this widget in the cui based on the Startx, Starty, Endx and Endy. It also registers all the key bindings that have been added to this widget