components

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MainMenu struct {
	*tview.Box
	// contains filtered or unexported fields
}

MainMenu is our main menu

func NewMainMenu

func NewMainMenu() *MainMenu

NewMainMenu creates an empty main menu

func (m *MainMenu) AddItem(text string, shortcut rune) *MainMenu

AddItem adds a new item to the main menu

func (m *MainMenu) Clear() *MainMenu

Clear will remove all menu items

func (m *MainMenu) Draw(screen tcell.Screen)

Draw will draw the main menu on screen

func (m *MainMenu) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler will be called when the main menu is active and we have an input. It will deal with navigating through the main menu

func (m *MainMenu) SetMainTextColor(c tcell.Color) *MainMenu

SetMainTextColor sets the main text color

func (m *MainMenu) SetSelectedBackgroundColor(c tcell.Color) *MainMenu

SetSelectedBackgroundColor is the selected background color

func (m *MainMenu) SetSelectedFunc(handler func(int, string, rune)) *MainMenu

SetSelectedFunc sets the function that is called when an item is selected

func (m *MainMenu) SetSelectedTextColor(c tcell.Color) *MainMenu

SetSelectedTextColor is the selected text color

type Menubar struct {
	*tview.Box
	DisplayTime bool
	Slots       [10]*menubarSlot
}

Menubar is a structure that holds a menu bar in the bottom

func NewMenubar

func NewMenubar(app *tview.Application) *Menubar

NewMenubar creates a new menu bar

func (m *Menubar) Draw(screen tcell.Screen)

Draw will draw the menubar on the screen

func (m *Menubar) SetDisplayTime(b bool) *Menubar

SetDisplayTime will display or undisplay the time

func (m *Menubar) SetSlot(idx int, text string, selected func()) *Menubar

SetSlot set the given menubar index with a menu item. It will call the selected() function whenever we select the given function from the menubar.

type MessageList

type MessageList struct {
	*tview.Box

	Items []message.DecryptedMessage
	// contains filtered or unexported fields
}

MessageList holds a list of messages

func NewMessageList

func NewMessageList() *MessageList

NewMessageList creates a new message list

func (*MessageList) Draw

func (m *MessageList) Draw(screen tcell.Screen)

Draw will draw the message list on the screen

func (*MessageList) InputHandler

func (m *MessageList) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler will be called when the focussed message list has input

func (*MessageList) SetSelectFunc

func (m *MessageList) SetSelectFunc(f func(ml MessageList, idx int))

SetSelectFunc will set the handler that will be called when a message is selected

Jump to

Keyboard shortcuts

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