From bbf81e344445f382cfbe42df73c8e3921e4c3956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Zywert?= Date: Wed, 5 Jun 2024 22:40:36 +0200 Subject: [PATCH] wip save --- gojira/help.go | 24 ++++++++++++++++++++++++ gojira/ui.go | 6 ++++-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 gojira/help.go diff --git a/gojira/help.go b/gojira/help.go new file mode 100644 index 0000000..2ef594c --- /dev/null +++ b/gojira/help.go @@ -0,0 +1,24 @@ +package gojira + +import "github.com/rivo/tview" + +type Help struct { + *tview.TextView +} + +func NewHelpView() *Help { + help := &Help{ + TextView: tview.NewTextView(), + } + help.SetText("Shortcuts:\n\n" + + "<- - previous day\n" + + "-> - next day\n" + + "shift + -> - next month\n" + + "shift + <- - previous month\n" + + "/ - search\n" + + "del - delete log\n" + + "enter - add/edit log\n" + + "tab - switch between lists", + ) + return help +} diff --git a/gojira/ui.go b/gojira/ui.go index 31b3b27..36530ba 100644 --- a/gojira/ui.go +++ b/gojira/ui.go @@ -13,6 +13,7 @@ type UserInteface struct { dayView *DayView errorView *ErrorView loaderView *LoaderView + helpView *Help } func newUi() { @@ -24,7 +25,7 @@ func newUi() { app.ui.dayView = NewDayView() app.ui.errorView = NewErrorView() app.ui.loaderView = NewLoaderView() - + app.ui.helpView = NewHelpView() app.ui.grid = tview.NewGrid(). SetRows(1, 0, 0). SetColumns(0, 0, 27). @@ -36,6 +37,7 @@ func newUi() { // Layout for screens wider than 100 cells. app.ui.grid.AddItem(app.ui.pages, 0, 0, 3, 2, 0, 100, true). AddItem(app.ui.summary, 0, 2, 1, 1, 0, 100, false). - AddItem(app.ui.calendar, 1, 2, 2, 1, 0, 100, false) + AddItem(app.ui.calendar, 1, 2, 1, 1, 0, 100, false). + AddItem(app.ui.helpView, 2, 2, 1, 1, 0, 100, false) app.ui.app.SetRoot(app.ui.grid, true).SetFocus(app.ui.pages) }