Documentation ¶
Index ¶
- func AddMenu(menuType string)
- func DrawMenu(x int, region string)
- func FocusMenu()
- func FocusedTable() *tview.Table
- func FocusedTableReference() (inv.SearchData, error)
- func GetCurrentTab() string
- func HorizontalLine() *tview.Box
- func InitMenu(menuItems map[string]*Menu)
- func MenuExit()
- func MenuHighlightHandler(added, removed, remaining []string)
- func MenuKeybindings(event *tcell.EventKey) *tcell.EventKey
- func ModifyReference(title string, add bool, info ...inv.SearchData) error
- func ResizeModal()
- func SelectTab(tab string)
- func SetContextMenu(menuType string, item tview.Primitive)
- func SetGlobalKeybindings(kb func(event *tcell.EventKey) *tcell.EventKey)
- func SetPrimaryFocus()
- func SetResizeHandler(resize func(screen tcell.Screen))
- func SetTab(tabInfo Tab)
- func Setup()
- func ShowError(err error)
- func ShowInfo(text string, persist bool)
- func Stop(skip ...struct{})
- func SwitchTab(reverse bool, tabs ...Tab) string
- func VerticalLine() *tview.Box
- type Application
- type FileBrowser
- type Menu
- type MenuArea
- type MenuOption
- type Modal
- type Status
- type Tab
- type TabInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FocusedTable ¶
FocusedTable returns the currently focused table.
func FocusedTableReference ¶
func FocusedTableReference() (inv.SearchData, error)
FocusedTableReference returns the currently selected entry's information from the focused table.
func HorizontalLine ¶
HorizontalLine returns a box with a thick horizontal line.
func MenuHighlightHandler ¶
func MenuHighlightHandler(added, removed, remaining []string)
MenuHighlightHandler draws the menu based on which menu name is highlighted.
func MenuKeybindings ¶
func MenuKeybindings(event *tcell.EventKey) *tcell.EventKey
MenuKeybindings describes the menu keybindings.
func ModifyReference ¶
func ModifyReference(title string, add bool, info ...inv.SearchData) error
ModifyReference modifies the currently selected entry within the focused table.
func ResizeModal ¶
func ResizeModal()
ResizeModal resizes the modal according to the current screen dimensions.
func SetContextMenu ¶
SetContextMenu sets the context menu.
func SetGlobalKeybindings ¶
func SetGlobalKeybindings(kb func(event *tcell.EventKey) *tcell.EventKey)
SetGlobalKeybindings sets the keybindings for the app.
func SetPrimaryFocus ¶
func SetPrimaryFocus()
SetPrimaryFocus sets the focus to the appropriate primitive.
func SetResizeHandler ¶
func SetResizeHandler(resize func(screen tcell.Screen))
SetResizeHandler sets the resize handler for the app.
func SwitchTab ¶
SwitchTab handles the tab selection. If reverse is set, the previous tab is selected and vice-versa.
func VerticalLine ¶
VerticalLine returns a box with a thick vertical line.
Types ¶
type Application ¶
type Application struct { MenuLayout *tview.Flex Menu, Tabs *tview.TextView Area *tview.Pages Pages *tview.Pages Layout, Region *tview.Flex Status Status FileBrowser FileBrowser SelectedStyle tcell.Style ColumnStyle tcell.Style Suspend bool Closed chan struct{} *tview.Application // contains filtered or unexported fields }
Application describes the layout of the app.
var UI Application
UI stores the application data.
type FileBrowser ¶
type FileBrowser struct {
// contains filtered or unexported fields
}
FileBrowser describes the layout of a file browser.
func (*FileBrowser) Keybindings ¶
func (f *FileBrowser) Keybindings(event *tcell.EventKey) *tcell.EventKey
Keybindings define the keybindings for the file browser.
func (*FileBrowser) Query ¶
func (f *FileBrowser) Query( prompt string, validate func(text string, reply chan string), max ...int, ) string
Query displays a confirmation message within the file browser.
func (*FileBrowser) Show ¶
func (f *FileBrowser) Show(prompt string, dofunc func(text string))
Show displays the file browser.
type Menu ¶
type Menu struct { Title string Options []*MenuOption }
Menu describes a menu and its options.
type MenuArea ¶
type MenuArea struct {
// contains filtered or unexported fields
}
MenuArea stores the menu modal and the current context menu.
type MenuOption ¶
MenuOption describes a menu option.
type Modal ¶
type Modal struct { Name string Open bool Height, Width int Flex *tview.Flex Table *tview.Table // contains filtered or unexported fields }
Modal stores a layout to display a floating modal.
func NewMenuModal ¶
NewMenuModal returns a menu modal.
type Status ¶
type Status struct { Message *tview.TextView Cancel context.CancelFunc *tview.Pages *tview.InputField // contains filtered or unexported fields }
Status describes the layout for a status bar
func (*Status) ErrorMessage ¶
ErrorMessage sends an error message to the status bar.
func (*Status) InfoMessage ¶
InfoMessage sends an info message to the status bar.
func (*Status) SetFocusFunc ¶
func (s *Status) SetFocusFunc(focus ...func())
SetFocusFunc sets the function to be executed when the input is focused.