diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-12 22:06:37 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-13 21:50:23 +1000 |
commit | 35b72420adebf7118f92e6d07109f4f0bfe204a7 (patch) | |
tree | 7fd13ce8b2a5866877989d843484c62a3d496c92 /pkg/gui/arrangement.go | |
parent | 28ba142fd6f091df4185bb06cfa24679d3de0ab6 (diff) |
support accordian mode i.e. expanding focused side panels
Diffstat (limited to 'pkg/gui/arrangement.go')
-rw-r--r-- | pkg/gui/arrangement.go | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/pkg/gui/arrangement.go b/pkg/gui/arrangement.go index bc7f674d1..aeb6ce59d 100644 --- a/pkg/gui/arrangement.go +++ b/pkg/gui/arrangement.go @@ -181,27 +181,27 @@ func (gui *Gui) sidePanelChildren(width int, height int) []*box { fullHeightBox("stash"), } } else if height >= 28 { + accordianMode := gui.Config.GetUserConfig().GetBool("gui.expandFocusedSidePanel") + accordianBox := func(defaultBox *box) *box { + if accordianMode && defaultBox.viewName == currentCyclableViewName { + return &box{ + viewName: defaultBox.viewName, + weight: 2, + } + } + + return defaultBox + } + return []*box{ { viewName: "status", size: 3, }, - { - viewName: "files", - weight: 1, - }, - { - viewName: "branches", - weight: 1, - }, - { - viewName: "commits", - weight: 1, - }, - { - viewName: "stash", - size: 3, - }, + accordianBox(&box{viewName: "files", weight: 1}), + accordianBox(&box{viewName: "branches", weight: 1}), + accordianBox(&box{viewName: "commits", weight: 1}), + accordianBox(&box{viewName: "stash", size: 3}), } } else { squashedHeight := 1 |