diff options
author | Dawid Dziurla <dawidd0811@gmail.com> | 2018-09-09 10:39:08 +0200 |
---|---|---|
committer | Dawid Dziurla <dawidd0811@gmail.com> | 2018-09-09 10:41:01 +0200 |
commit | 6f7de83bcee20ab14556b95041695b959dfb407b (patch) | |
tree | ebedfd0baaa505965bba3efba91e561c679a90b3 /pkg/gui/view_helpers.go | |
parent | e80371fc6f1dbbf826fcf97626eaa4bc445736f9 (diff) | |
parent | 5af03b68206fcfe1a22a9a4c74d730d2b1b13603 (diff) |
Merge branch 'master' into feature/help
conflicts resolved
Diffstat (limited to 'pkg/gui/view_helpers.go')
-rw-r--r-- | pkg/gui/view_helpers.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index 88b74d12e..7a5bd8874 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -277,3 +277,25 @@ func (gui *Gui) currentViewName(g *gocui.Gui) string { currentView := g.CurrentView() return currentView.Name() } + +func (gui *Gui) resizeCurrentPopupPanel(g *gocui.Gui) error { + v := g.CurrentView() + if v.Name() == "commitMessage" || v.Name() == "confirmation" { + return gui.resizePopupPanel(g, v) + } + return nil +} + +func (gui *Gui) resizePopupPanel(g *gocui.Gui, v *gocui.View) error { + // If the confirmation panel is already displayed, just resize the width, + // otherwise continue + content := v.Buffer() + x0, y0, x1, y1 := gui.getConfirmationPanelDimensions(g, content) + vx0, vy0, vx1, vy1 := v.Dimensions() + if vx0 == x0 && vy0 == y0 && vx1 == x1 && vy1 == y1 { + return nil + } + gui.Log.Info(gui.Tr.SLocalize("resizingPopupPanel")) + _, err := g.SetView(v.Name(), x0, y0, x1, y1, 0) + return err +} |