diff options
| author | Jeff Carr <[email protected]> | 2025-02-07 03:26:05 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-07 03:26:05 -0600 |
| commit | 13a194dca5d9c6153772d2ef4e1f5ce93f191c6d (patch) | |
| tree | f8cccff1a4597968e18a1d882431305bc83babc5 /eventBindings.go | |
| parent | 6c522a4b271dd978928ec0079a6be205edb22727 (diff) | |
more on dark mode
Diffstat (limited to 'eventBindings.go')
| -rw-r--r-- | eventBindings.go | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/eventBindings.go b/eventBindings.go index 5b39457..121f95f 100644 --- a/eventBindings.go +++ b/eventBindings.go @@ -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 { |
