mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Begin refactoring gui
This begins a big refactor of moving more code out of the Gui struct into contexts, controllers, and helpers. We also move some code into structs in the gui package purely for the sake of better encapsulation
This commit is contained in:
@ -44,6 +44,14 @@ func (self *MenuController) GetOnClick() func() error {
|
||||
return self.press
|
||||
}
|
||||
|
||||
func (self *MenuController) GetOnFocus() func(types.OnFocusOpts) error {
|
||||
return func(types.OnFocusOpts) error {
|
||||
selectedMenuItem := self.context().GetSelected()
|
||||
self.c.Views().Tooltip.SetContent(selectedMenuItem.Tooltip)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func (self *MenuController) press() error {
|
||||
return self.context().OnMenuPress(self.context().GetSelected())
|
||||
}
|
||||
|
Reference in New Issue
Block a user