Documentation ¶
Index ¶
- func AddMenu(menuType keybinding.KeyContext)
- func ConditionalDraw(mustDraw func() bool)
- func DrawMenu(x int, region string)
- func DrawPrimitives(primitives ...tview.Primitive)
- func FocusMenu()
- func FocusedTable() *tview.Table
- func FocusedTableReference() (inv.SearchData, error)
- func GetCurrentTab() string
- func HorizontalLine(property theme.ThemeProperty) *tview.Box
- func InitMenu(data *MenuData)
- 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 keybinding.KeyContext, 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, context theme.ThemeContext)
- func SetTableSelector(t *tview.Table, prevrows int)
- func Setup() error
- func ShowError(err error)
- func ShowInfo(text string, persist bool, print ...bool)
- func Stop(skip ...struct{})
- func SwitchTab(reverse bool, tabs ...Tab) string
- func VerticalLine(property theme.ThemeProperty) *tview.Box
- type Application
- type FileBrowser
- func (f *FileBrowser) Hide()
- func (f *FileBrowser) IsOpen() bool
- func (f *FileBrowser) Keybindings(event *tcell.EventKey) *tcell.EventKey
- func (f *FileBrowser) Query(prompt string, validate func(text string, reply chan string), max ...int) string
- func (f *FileBrowser) SaveFile(file string, ...)
- func (f *FileBrowser) Show(prompt string, dofunc func(text string), options ...FileBrowserOptions)
- func (f *FileBrowser) ThemeProperty() theme.ThemeProperty
- type FileBrowserOptions
- type MenuArea
- type MenuData
- type Modal
- type Status
- func (s *Status) ErrorMessage(err error)
- func (s *Status) InfoMessage(text string, persist bool)
- func (s *Status) SetFocusFunc(focus ...func())
- func (s *Status) SetInput(label string, max int, clearInput bool, dofunc func(text string), ...)
- func (s *Status) Setup()
- func (s *Status) Tag(tag string)
- func (s *Status) ThemeProperty() theme.ThemeProperty
- type Tab
- type TabInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConditionalDraw ¶ added in v0.4.3
func ConditionalDraw(mustDraw func() bool)
ConditionalDraw redraws the screen according to the conditional mustDraw parameter.
func DrawPrimitives ¶ added in v0.3.8
DrawPrimitives draws the primitives onto the screen.
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 ¶
func HorizontalLine(property theme.ThemeProperty) *tview.Box
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 ¶
func SetContextMenu(menuType keybinding.KeyContext, item tview.Primitive)
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 SetTableSelector ¶ added in v0.4.2
SetTableSelector sets the table's selector position.
func SwitchTab ¶
SwitchTab handles the tab selection. If reverse is set, the previous tab is selected and vice-versa.
func VerticalLine ¶
func VerticalLine(property theme.ThemeProperty) *tview.Box
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 Suspend bool Closed context.Context Exit context.CancelFunc Screen tcell.Screen *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) IsOpen ¶ added in v0.4.3
func (f *FileBrowser) IsOpen() bool
IsOpen returns whether the filebrowser is open.
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) SaveFile ¶ added in v0.3.6
func (f *FileBrowser) SaveFile( file string, entriesFunc func(flags int, appendToFile bool) (string, int, error), )
SaveFile saves the generated entries into a file.
func (*FileBrowser) Show ¶
func (f *FileBrowser) Show(prompt string, dofunc func(text string), options ...FileBrowserOptions)
Show displays the file browser.
func (*FileBrowser) ThemeProperty ¶ added in v0.3.8
func (f *FileBrowser) ThemeProperty() theme.ThemeProperty
ThemeProperty returns the filebrowser's theme property.
type FileBrowserOptions ¶ added in v0.3.3
FileBrowserOptions describes the file browser options.
type MenuArea ¶
type MenuArea struct {
// contains filtered or unexported fields
}
MenuArea stores the menu modal and the current context menu.
type MenuData ¶ added in v0.3.3
type MenuData struct { Visible map[keybinding.Key]func(menuType string) bool Items map[keybinding.KeyContext][]keybinding.Key }
MenuData stores the menu items and handlers.
type Modal ¶
type Modal struct { Name string Open bool Height, Width int Flex *tview.Flex Table *tview.Table Title *tview.TextView // contains filtered or unexported fields }
Modal stores a layout to display a floating modal.
func NewMenuModal ¶
func NewMenuModal(name string, regionX, regionY int, property theme.ThemeProperty) *Modal
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.
func (*Status) SetInput ¶
func (s *Status) SetInput(label string, max int, clearInput bool, dofunc func(text string), ifunc func(event *tcell.EventKey) *tcell.EventKey, chgfunc ...func(text string), )
SetInput sets up the prompt and appropriate handlers for the input area within the status bar.
func (*Status) ThemeProperty ¶ added in v0.3.8
func (s *Status) ThemeProperty() theme.ThemeProperty