help view opens on startup (kinda)

This commit is contained in:
Jeff Carr 2025-02-01 19:00:15 -06:00
parent eccec3ef1a
commit e3c874cd69
3 changed files with 21 additions and 14 deletions

View File

@ -188,19 +188,11 @@ func theLetterD(g *gocui.Gui, v *gocui.View) error {
func theHelp(g *gocui.Gui, v *gocui.View) error { func theHelp(g *gocui.Gui, v *gocui.View) error {
if me.showHelp { if me.showHelp {
helplayout() log.Info("Show the help!")
me.showHelp = false showHelp()
/*
if me.dropdownV == nil {
log.Info("FIXME: MADE me.dropdownV AGAIN")
me.dropdownV = makeDropdownView("addWidget() ddview help")
}
*/
// me.dropdownV.Show()
} else { } else {
me.baseGui.DeleteView("help") log.Info("Hide the help!")
me.showHelp = true hideHelp()
// me.dropdownV.Hide()
} }
return nil return nil
} }

17
help.go
View File

@ -13,6 +13,7 @@ import (
"strings" "strings"
"github.com/awesome-gocui/gocui" "github.com/awesome-gocui/gocui"
log "go.wit.com/log"
) )
/* /*
@ -41,11 +42,23 @@ var helpText []string = []string{"KEYBINDINGS",
"", "",
} }
func hidehelplayout() { func hideHelp() {
if me.showHelp {
log.Info("help is already down")
me.showHelp = true
return
}
me.showHelp = true
me.baseGui.DeleteView("help") me.baseGui.DeleteView("help")
} }
func helplayout() error { func showHelp() error {
if !me.showHelp {
log.Info("help is already up")
me.showHelp = false
return nil
}
me.showHelp = false
g := me.baseGui g := me.baseGui
var err error var err error
maxX, _ := g.Size() maxX, _ := g.Size()

View File

@ -55,6 +55,8 @@ func addWidget(n *tree.Node) {
// if me.dropdownV == nil { // if me.dropdownV == nil {
// me.dropdownV = makeDropdownView("addWidget() ddview2") // me.dropdownV = makeDropdownView("addWidget() ddview2")
// } // }
hideHelp()
showHelp()
return return
case widget.Tab: case widget.Tab:
nw.color = &colorTab nw.color = &colorTab