diff options
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/controllers/menu_controller.go | 8 | ||||
-rw-r--r-- | pkg/gui/keybindings.go | 6 | ||||
-rw-r--r-- | pkg/gui/menu_panel.go | 4 | ||||
-rw-r--r-- | pkg/gui/options_menu_panel.go | 3 |
4 files changed, 10 insertions, 11 deletions
diff --git a/pkg/gui/controllers/menu_controller.go b/pkg/gui/controllers/menu_controller.go index f217c993a..910e50668 100644 --- a/pkg/gui/controllers/menu_controller.go +++ b/pkg/gui/controllers/menu_controller.go @@ -35,6 +35,10 @@ func (self *MenuController) GetKeybindings(opts types.KeybindingsOpts) []*types. Key: opts.GetKey(opts.Config.Universal.ConfirmAlt1), Handler: self.press, }, + { + Key: opts.GetKey(opts.Config.Universal.Return), + Handler: self.close, + }, } return bindings @@ -58,6 +62,10 @@ func (self *MenuController) press() error { return nil } +func (self *MenuController) close() error { + return self.c.PopContext() +} + func (self *MenuController) Context() types.Context { return self.context() } diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 8f70045d0..cfcd50822 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -413,12 +413,6 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi Description: self.c.Tr.LcCopyCommitShaToClipboard, }, { - ViewName: "menu", - Key: opts.GetKey(opts.Config.Universal.Return), - Handler: self.handleMenuClose, - Description: self.c.Tr.LcCloseMenu, - }, - { ViewName: "information", Key: gocui.MouseLeft, Modifier: gocui.ModNone, diff --git a/pkg/gui/menu_panel.go b/pkg/gui/menu_panel.go index e787162ed..7bf68c519 100644 --- a/pkg/gui/menu_panel.go +++ b/pkg/gui/menu_panel.go @@ -18,10 +18,6 @@ func (gui *Gui) getMenuOptions() map[string]string { } } -func (gui *Gui) handleMenuClose() error { - return gui.c.PopContext() -} - // note: items option is mutated by this function func (gui *Gui) createMenu(opts types.CreateMenuOptions) error { if !opts.HideCancel { diff --git a/pkg/gui/options_menu_panel.go b/pkg/gui/options_menu_panel.go index c21a9dce3..20df7e091 100644 --- a/pkg/gui/options_menu_panel.go +++ b/pkg/gui/options_menu_panel.go @@ -70,7 +70,8 @@ func (gui *Gui) handleCreateOptionsMenu() error { if binding.Key == nil { return nil } - if err := gui.handleMenuClose(); err != nil { + + if err := gui.c.PopContext(); err != nil { return err } return binding.Handler() |