Documentation ¶
Index ¶
- type NavigationBar
- func (n *NavigationBar) AddButton(label string, selected func()) *NavigationBar
- func (n *NavigationBar) Blur()
- func (n *NavigationBar) ClearUserFeedback() *NavigationBar
- func (n *NavigationBar) Draw(screen tcell.Screen)
- func (n *NavigationBar) Focus(delegate func(p tview.Primitive))
- func (n *NavigationBar) GetFieldWidth() int
- func (n *NavigationBar) GetHeight() int
- func (n *NavigationBar) GetLabel() string
- func (n *NavigationBar) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (n *NavigationBar) SetAlign(align int) *NavigationBar
- func (n *NavigationBar) SetBackgroundColorActivated(color tcell.Color) *NavigationBar
- func (n *NavigationBar) SetFinishedFunc(handler func(key tcell.Key)) tview.FormItem
- func (n *NavigationBar) SetFormAttributes(labelWidth int, labelColor, bgColor, fieldTextColor, fieldBgColor tcell.Color) tview.FormItem
- func (n *NavigationBar) SetLabelColor(color tcell.Color) *NavigationBar
- func (n *NavigationBar) SetLabelColorActivated(color tcell.Color) *NavigationBar
- func (n *NavigationBar) SetNavBackgroundColor(color tcell.Color) *NavigationBar
- func (n *NavigationBar) SetOnBlurFunc(handler func()) *NavigationBar
- func (n *NavigationBar) SetOnFocusFunc(handler func()) *NavigationBar
- func (n *NavigationBar) SetSelectedButton(selected int) *NavigationBar
- func (n *NavigationBar) SetUserFeedback(feedback string, color tcell.Color) *NavigationBar
- func (n *NavigationBar) UnfocusedInputHandler(event *tcell.EventKey) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NavigationBar ¶
type NavigationBar struct { // contains filtered or unexported fields }
NavigationBar is transparent horizontal form for navigation that always has a button selected.
Unlike a typical Primitive, NavigationBar is meant to consume input and appear in focus alongside other infocus elements.
func NewNavigationBar ¶
func NewNavigationBar() *NavigationBar
NewNavigationBar returns a new navigation bar.
func (*NavigationBar) AddButton ¶
func (n *NavigationBar) AddButton(label string, selected func()) *NavigationBar
AddButton adds a new button to the navigationbar. The "selected" function is called when the user selects this button. It may be nil.
func (*NavigationBar) Blur ¶
func (n *NavigationBar) Blur()
Blur is called when this primitive loses focus.
func (*NavigationBar) ClearUserFeedback ¶
func (n *NavigationBar) ClearUserFeedback() *NavigationBar
ClearUserFeedback removes any currently showing feedback.
func (*NavigationBar) Draw ¶
func (n *NavigationBar) Draw(screen tcell.Screen)
Draw renders this primitive onto the screen.
func (*NavigationBar) Focus ¶
func (n *NavigationBar) Focus(delegate func(p tview.Primitive))
Focus is called when this primitive receives focus.
func (*NavigationBar) GetFieldWidth ¶
func (n *NavigationBar) GetFieldWidth() int
GetFieldWidth returns this primitive's field screen width.
func (*NavigationBar) GetHeight ¶
func (n *NavigationBar) GetHeight() int
GetHeight returns the height of the navbar.
func (*NavigationBar) GetLabel ¶
func (n *NavigationBar) GetLabel() string
GetLabel returns the text to be displayed before the input area.
func (*NavigationBar) InputHandler ¶
func (n *NavigationBar) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
InputHandler returns the handler for this primitive.
func (*NavigationBar) SetAlign ¶
func (n *NavigationBar) SetAlign(align int) *NavigationBar
SetAlign sets how the buttons align horizontally. Options include: - AlignLeft (default) - AlignCenter - AlignRight
func (*NavigationBar) SetBackgroundColorActivated ¶
func (n *NavigationBar) SetBackgroundColorActivated(color tcell.Color) *NavigationBar
SetBackgroundColorActivated sets the background color of the button text when the button is selected.
func (*NavigationBar) SetFinishedFunc ¶
func (n *NavigationBar) SetFinishedFunc(handler func(key tcell.Key)) tview.FormItem
SetFinishedFunc sets a callback invoked when the user leaves this form item.
func (*NavigationBar) SetFormAttributes ¶
func (n *NavigationBar) SetFormAttributes(labelWidth int, labelColor, bgColor, fieldTextColor, fieldBgColor tcell.Color) tview.FormItem
SetFormAttributes sets attributes shared by all form items.
func (*NavigationBar) SetLabelColor ¶
func (n *NavigationBar) SetLabelColor(color tcell.Color) *NavigationBar
SetLabelColor sets the color of button text.
func (*NavigationBar) SetLabelColorActivated ¶
func (n *NavigationBar) SetLabelColorActivated(color tcell.Color) *NavigationBar
SetLabelColorActivated sets the color of button text when the button is selected.
func (*NavigationBar) SetNavBackgroundColor ¶
func (n *NavigationBar) SetNavBackgroundColor(color tcell.Color) *NavigationBar
SetNavBackgroundColor sets the background color.
func (*NavigationBar) SetOnBlurFunc ¶
func (n *NavigationBar) SetOnBlurFunc(handler func()) *NavigationBar
SetOnBlurFunc sets a callback invoked when this primitive loses focus.
func (*NavigationBar) SetOnFocusFunc ¶
func (n *NavigationBar) SetOnFocusFunc(handler func()) *NavigationBar
SetOnFocusFunc sets a callback invoked when this primitive receives focus.
func (*NavigationBar) SetSelectedButton ¶
func (n *NavigationBar) SetSelectedButton(selected int) *NavigationBar
SetSelectedButton sets which button is currently selected.
func (*NavigationBar) SetUserFeedback ¶
func (n *NavigationBar) SetUserFeedback(feedback string, color tcell.Color) *NavigationBar
SetUserFeedback sets a message for the user in a given color.
func (*NavigationBar) UnfocusedInputHandler ¶
func (n *NavigationBar) UnfocusedInputHandler(event *tcell.EventKey) bool
UnfocusedInputHandler handles input even when this primitive is not in focus. Returns true if a key event was consumed.