more on dark mode
This commit is contained in:
parent
6c522a4b27
commit
13a194dca5
|
@ -33,8 +33,9 @@ func registerHandlers(g *gocui.Gui) {
|
|||
g.SetKeybinding("", keyForced, modForced, handle_ctrl_z) // CTRL-Z :cleverly let's you background gocui (breaks cursor mouse on return)
|
||||
|
||||
// regular keys
|
||||
g.SetKeybinding("", 'H', gocui.ModNone, theHelp) // '?' toggles on and off the help menu
|
||||
g.SetKeybinding("", 'O', gocui.ModNone, theStdout) // 'o' toggle the STDOUT window
|
||||
g.SetKeybinding("", 'H', gocui.ModNone, theHelp) // 'H' toggles on and off the help menu
|
||||
g.SetKeybinding("", 'O', gocui.ModNone, theStdout) // 'O' toggle the STDOUT window
|
||||
g.SetKeybinding("", 'D', gocui.ModNone, theDarkness) // 'D' toggles light/dark mode
|
||||
g.SetKeybinding("", 'q', gocui.ModNone, doExit) // 'q' exit
|
||||
g.SetKeybinding("", gocui.KeyTab, gocui.ModNone, tabCycleWindows) // '2' use this to test new ideas
|
||||
g.SetKeybinding("", gocui.KeyPgup, gocui.ModNone, stdoutPgup) // Pgup scroll up the Stdout buffer
|
||||
|
@ -108,6 +109,17 @@ func theNotsure(g *gocui.Gui, v *gocui.View) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func theDarkness(g *gocui.Gui, v *gocui.View) error {
|
||||
if me.dark {
|
||||
me.dark = false
|
||||
log.Info("you have seen the light")
|
||||
} else {
|
||||
me.dark = true
|
||||
log.Info("you have entered into darkness")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func stdoutPgup(g *gocui.Gui, v *gocui.View) error {
|
||||
me.stdout.pager -= 40
|
||||
if me.stdout.pager < 0 {
|
||||
|
|
8
help.go
8
help.go
|
@ -26,13 +26,15 @@ import (
|
|||
var helpText []string = []string{"Help Menu",
|
||||
"",
|
||||
"H: toggle (H)elp",
|
||||
"D: toggle light/dark mode",
|
||||
"Tab: toggle through windows",
|
||||
"q: quit()",
|
||||
"",
|
||||
"Debugging:",
|
||||
"O: toggle (O)output (os.STDOUT)",
|
||||
"S: super mouse",
|
||||
"M: list all widgets positions",
|
||||
"L: list all widgets in tree",
|
||||
"Tab: toggle through windows",
|
||||
"q: quit()",
|
||||
"",
|
||||
}
|
||||
|
||||
func hideHelp() {
|
||||
|
|
Loading…
Reference in New Issue