navigationbar

package
v0.0.0-...-4cb4cf9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NavigationBar struct {
	*tview.Box
	// 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 (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 (n *NavigationBar) Blur()

Blur is called when this primitive loses focus.

func (n *NavigationBar) ClearUserFeedback() *NavigationBar

ClearUserFeedback removes any currently showing feedback.

func (n *NavigationBar) Draw(screen tcell.Screen)

Draw renders this primitive onto the screen.

func (n *NavigationBar) Focus(delegate func(p tview.Primitive))

Focus is called when this primitive receives focus.

func (n *NavigationBar) GetFieldWidth() int

GetFieldWidth returns this primitive's field screen width.

func (n *NavigationBar) GetHeight() int

GetHeight returns the height of the navbar.

func (n *NavigationBar) GetLabel() string

GetLabel returns the text to be displayed before the input area.

func (n *NavigationBar) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns the handler for this primitive.

func (n *NavigationBar) SetAlign(align int) *NavigationBar

SetAlign sets how the buttons align horizontally. Options include: - AlignLeft (default) - AlignCenter - AlignRight

func (n *NavigationBar) SetBackgroundColorActivated(color tcell.Color) *NavigationBar

SetBackgroundColorActivated sets the background color of the button text when the button is selected.

func (n *NavigationBar) SetFinishedFunc(handler func(key tcell.Key)) tview.FormItem

SetFinishedFunc sets a callback invoked when the user leaves this form item.

func (n *NavigationBar) SetFormAttributes(labelWidth int, labelColor, bgColor, fieldTextColor, fieldBgColor tcell.Color) tview.FormItem

SetFormAttributes sets attributes shared by all form items.

func (n *NavigationBar) SetLabelColor(color tcell.Color) *NavigationBar

SetLabelColor sets the color of button text.

func (n *NavigationBar) SetLabelColorActivated(color tcell.Color) *NavigationBar

SetLabelColorActivated sets the color of button text when the button is selected.

func (n *NavigationBar) SetNavBackgroundColor(color tcell.Color) *NavigationBar

SetNavBackgroundColor sets the background color.

func (n *NavigationBar) SetOnBlurFunc(handler func()) *NavigationBar

SetOnBlurFunc sets a callback invoked when this primitive loses focus.

func (n *NavigationBar) SetOnFocusFunc(handler func()) *NavigationBar

SetOnFocusFunc sets a callback invoked when this primitive receives focus.

func (n *NavigationBar) SetSelectedButton(selected int) *NavigationBar

SetSelectedButton sets which button is currently selected.

func (n *NavigationBar) SetUserFeedback(feedback string, color tcell.Color) *NavigationBar

SetUserFeedback sets a message for the user in a given color.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL