summaryrefslogtreecommitdiff
path: root/toolkit/democui/keybindings.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-03-30 08:51:33 -0500
committerJeff Carr <[email protected]>2023-03-30 08:51:33 -0500
commit0320ebe4bb49ea80761d77af80fa208157ffdb89 (patch)
tree6df3a9612aa081f476d1add018a456d332967ac4 /toolkit/democui/keybindings.go
parent610e2adad1f30edf5f8408fa31c85224e476f4e0 (diff)
'hide' and 'show' works in gocui
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/democui/keybindings.go')
-rw-r--r--toolkit/democui/keybindings.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/toolkit/democui/keybindings.go b/toolkit/democui/keybindings.go
index 8e5e937..977a375 100644
--- a/toolkit/democui/keybindings.go
+++ b/toolkit/democui/keybindings.go
@@ -32,11 +32,28 @@ func defaultKeybindings(g *gocui.Gui) error {
// dump out the widgets
func addDebugKeys(g *gocui.Gui) {
+ // dump all widget info to the log
g.SetKeybinding("", 'd', gocui.ModNone,
func(g *gocui.Gui, v *gocui.View) error {
dumpWidgets(g, v)
return nil
})
+
+ // hide all widgets
+ g.SetKeybinding("", 'h', gocui.ModNone,
+ func(g *gocui.Gui, v *gocui.View) error {
+ hideWidgets()
+ return nil
+ })
+
+ // show all widgets
+ g.SetKeybinding("", 's', gocui.ModNone,
+ func(g *gocui.Gui, v *gocui.View) error {
+ showWidgets()
+ return nil
+ })
+
+ // try to adjust all the widget positions
g.SetKeybinding("", 'r', gocui.ModNone,
func(g *gocui.Gui, v *gocui.View) error {
adjustWidgets()