diff options
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r-- | pkg/gui/gui.go | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 1af3a5e1f..6a7eaaf98 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -95,12 +95,17 @@ type stashPanelState struct { SelectedLine int } +type menuPanelState struct { + SelectedLine int +} + type panelStates struct { Files *filePanelState Staging *stagingPanelState Branches *branchPanelState Commits *commitPanelState Stash *stashPanelState + Menu *menuPanelState } type guiState struct { @@ -137,6 +142,7 @@ func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *comma Branches: &branchPanelState{SelectedLine: 0}, Commits: &commitPanelState{SelectedLine: -1}, Stash: &stashPanelState{SelectedLine: -1}, + Menu: &menuPanelState{SelectedLine: 0}, }, } @@ -359,12 +365,12 @@ func (gui *Gui) layout(g *gocui.Gui) error { } gui.g.SetCurrentView(filesView.Name()) - gui.refreshFiles(g) - gui.refreshBranches(g) - gui.refreshCommits(g) - gui.refreshStashEntries(g) - if err := gui.renderGlobalOptions(g); err != nil { - return err + + gui.refreshSidePanels(gui.g) + if gui.g.CurrentView().Name() != "menu" { + if err := gui.renderGlobalOptions(g); err != nil { + return err + } } if err := gui.switchFocus(g, nil, filesView); err != nil { return err @@ -388,6 +394,9 @@ func (gui *Gui) layout(g *gocui.Gui) error { } } + // TODO: comment-out + gui.Log.Info(utils.AsJson(gui.State)) + return gui.resizeCurrentPopupPanel(g) } |