mirror of
https://github.com/aditya-K2/gspt.git
synced 2026-01-09 13:58:05 -05:00
Remove ui/sidenav
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"github.com/gdamore/tcell/v2"
|
||||
"github.com/rivo/tview"
|
||||
)
|
||||
|
||||
var (
|
||||
SideNavActions map[string]*Action
|
||||
)
|
||||
|
||||
func NewSideNav(m map[tcell.Key]string) *tview.Table {
|
||||
T := tview.NewTable()
|
||||
|
||||
mapSideNavActions(T, m)
|
||||
|
||||
return T
|
||||
}
|
||||
|
||||
func mapSideNavActions(T *tview.Table, f map[tcell.Key]string) {
|
||||
T.SetInputCapture(func(e *tcell.EventKey) *tcell.EventKey {
|
||||
if action, ok := f[e.Key()]; ok {
|
||||
SideNavActions[action].Func()(e)
|
||||
}
|
||||
return e
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user