Fix the selection style

This commit is contained in:
Sameer Rahmani 2022-11-25 15:30:24 +00:00
parent a9d729e894
commit 275a42440a
1 changed files with 7 additions and 1 deletions

View File

@ -41,6 +41,11 @@ var highlight,
selectionArrow,
normalArrow tcell.Style
type Scene struct {
ID int
RenderFn func(*State, Items)
}
type State struct {
Current int
InSelectionMode bool
@ -69,7 +74,7 @@ func drawText(s tcell.Screen, x1, y1, x2, y2 int, style tcell.Style, text string
}
// Main render function that gets called during the event loop.
func Render(s State, inputs Items) {
func Render(s *State, inputs Items) {
y := 2
status := fmt.Sprintf("Navigation: [UP or C-p] [Down or C-n] | Select: SPACE | Cancel: [q ESC] | Done: [Enter] | Line: %d", s.Current+1)
drawText(*s.Screen, 0, 0, xmax-1, 1, helpStyle, status)
@ -231,6 +236,7 @@ func main() {
}
state.InSelectionMode = !state.InSelectionMode
} else if ev.Rune() == '?' {
}
}
}