forked from RasmusLindroth/tut
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
41 lines (37 loc) · 1.59 KB
/
main.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
33
34
35
36
37
38
39
40
41
package main
import (
"github.com/RasmusLindroth/tut/auth"
"github.com/RasmusLindroth/tut/config"
"github.com/RasmusLindroth/tut/ui"
"github.com/RasmusLindroth/tut/util"
"github.com/rivo/tview"
)
const version = "1.0.12"
func main() {
util.MakeDirs()
newUser, selectedUser := ui.CliView(version)
accs := auth.StartAuth(newUser)
app := tview.NewApplication()
t := &ui.Tut{
App: app,
Config: config.Load(),
}
tview.Styles = tview.Theme{
PrimitiveBackgroundColor: t.Config.Style.Background, // background
ContrastBackgroundColor: t.Config.Style.Text, //background for button, checkbox, form, modal
MoreContrastBackgroundColor: t.Config.Style.Text, //background for dropdown
BorderColor: t.Config.Style.Background, //border
TitleColor: t.Config.Style.Text, //titles
GraphicsColor: t.Config.Style.Text, //borders
PrimaryTextColor: t.Config.Style.StatusBarViewBackground, //backround color selected
SecondaryTextColor: t.Config.Style.Text, //text
TertiaryTextColor: t.Config.Style.Text, //list secondary
InverseTextColor: t.Config.Style.Text, //label activated
ContrastSecondaryTextColor: t.Config.Style.Text, //foreground on input and prefix on dropdown
}
main := ui.NewTutView(t, accs, selectedUser)
app.SetInputCapture(main.Input)
if err := app.SetRoot(main.View, true).Run(); err != nil {
panic(err)
}
}