diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-12 22:18:03 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-13 21:50:23 +1000 |
commit | 8430b04492e74b760fc92fc65a619e46e61d3a6a (patch) | |
tree | 1d1e1c3333fa7f5b8fede31a99c2f4803c72f280 | |
parent | 35b72420adebf7118f92e6d07109f4f0bfe204a7 (diff) |
allow configurable main panel split
-rw-r--r-- | docs/Config.md | 1 | ||||
-rw-r--r-- | pkg/config/app_config.go | 1 | ||||
-rw-r--r-- | pkg/gui/arrangement.go | 13 |
3 files changed, 13 insertions, 2 deletions
diff --git a/docs/Config.md b/docs/Config.md index 14da960ec..aa84c980d 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -15,6 +15,7 @@ Default path for the config file: scrollPastBottom: true # enable scrolling past the bottom sidePanelWidth: 0.3333 # number from 0 to 1 expandFocusedSidePanel: false + mainPanelSplitMode: 'flexible' # one of 'horizontal' | 'flexible' | 'vertical' theme: lightTheme: false # For terminals with a light background activeBorderColor: diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index 668bc3477..7509df1c3 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -247,6 +247,7 @@ func GetDefaultConfig() []byte { skipStashWarning: true sidePanelWidth: 0.3333 expandFocusedSidePanel: false + mainPanelSplitMode: 'flexible' # one of 'horizontal' | 'flexible' | 'vertical' theme: lightTheme: false activeBorderColor: diff --git a/pkg/gui/arrangement.go b/pkg/gui/arrangement.go index aeb6ce59d..9380465a2 100644 --- a/pkg/gui/arrangement.go +++ b/pkg/gui/arrangement.go @@ -132,10 +132,19 @@ func (gui *Gui) getViewDimensions(informationStr string, appStatus string) map[s }, { conditionalDirection: func(width int, height int) int { - if width < 160 && height > 30 { // 2 80 character width panels + mainPanelSplitMode := gui.Config.GetUserConfig().GetString("gui.mainPanelSplitMode") + + switch mainPanelSplitMode { + case "vertical": return ROW - } else { + case "horizontal": return COLUMN + default: + if width < 160 && height > 30 { // 2 80 character width panels + return ROW + } else { + return COLUMN + } } }, direction: COLUMN, |