-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_flex_buttons_line.go
32 lines (26 loc) · 1.1 KB
/
view_flex_buttons_line.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
import (
"github.com/rivo/tview"
)
// TODO: Add buttons: About (0), Settings (S)
func GetButtonsFlex() *tview.Flex {
buttonsFlex := tview.NewFlex()
buttonLock = tview.NewButton("Lock (L)").SetSelectedFunc(actionLock)
buttonAddItem = tview.NewButton("Add Item (1)").SetSelectedFunc(addItemButtonPressed)
buttonAddField = tview.NewButton("Add Field (2)").SetSelectedFunc(addFieldButtonPressed)
buttonSettings = tview.NewButton("Settings (S)").SetSelectedFunc(addFieldButtonPressed)
buttonAbout = tview.NewButton("About (A)").SetSelectedFunc(aboutButtonPressed)
buttonQuit = tview.NewButton("Quit (Ctrl+Q)").SetSelectedFunc(actionStopApp)
buttonsFlex.AddItem(buttonLock, 15, 0, false).
AddItem(tview.NewBox(), 1, 0, false).
AddItem(buttonAddItem, 15, 0, false).
AddItem(tview.NewBox(), 1, 0, false).
AddItem(buttonAddField, 15, 0, false).
AddItem(tview.NewBox(), 1, 0, false).
AddItem(buttonSettings, 15, 0, false).
AddItem(tview.NewBox(), 1, 0, false).
AddItem(buttonAbout, 15, 0, false).
AddItem(tview.NewBox(), 1, 0, false).
AddItem(buttonQuit, 15, 0, false)
return buttonsFlex
}