diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index de0495466f5..117a2f3709f 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -82,6 +82,11 @@ type GuiConfig struct { // - 'vertical': split the window vertically // - 'flexible': (default) split the window horizontally if the window is wide enough, otherwise split vertically MainPanelSplitMode string `yaml:"mainPanelSplitMode"` + // How the window is split when in half screen mode (i.e. after hitting '+' once). + // Possible values: + // - 'horizontal': split the window horizontally (side panel on the left, main view on the right) + // - 'vertical': split the window vertically (side panel on top, main view below) + HalfScreenSplitMode string `yaml:"halfScreenSplitMode"` // One of 'auto' (default) | 'en' | 'zh-CN' | 'zh-TW' | 'pl' | 'nl' | 'ja' | 'ko' | 'ru' Language string `yaml:"language"` // Format used when displaying time e.g. commit time. @@ -589,6 +594,7 @@ func GetDefaultConfig() *UserConfig { SidePanelWidth: 0.3333, ExpandFocusedSidePanel: false, MainPanelSplitMode: "flexible", + HalfScreenSplitMode: "horizontal", Language: "auto", TimeFormat: "02 Jan 06", ShortTimeFormat: time.Kitchen, diff --git a/pkg/gui/controllers/helpers/window_arrangement_helper.go b/pkg/gui/controllers/helpers/window_arrangement_helper.go index 7f4261d8bde..654579f39be 100644 --- a/pkg/gui/controllers/helpers/window_arrangement_helper.go +++ b/pkg/gui/controllers/helpers/window_arrangement_helper.go @@ -35,6 +35,10 @@ func NewWindowArrangementHelper( const INFO_SECTION_PADDING = " " func (self *WindowArrangementHelper) shouldUsePortraitMode(width, height int) bool { + if self.c.State().GetRepoState().GetScreenMode() == types.SCREEN_HALF { + return self.c.UserConfig.Gui.HalfScreenSplitMode == "vertical" + } + switch self.c.UserConfig.Gui.PortraitMode { case "never": return false @@ -174,7 +178,11 @@ func (self *WindowArrangementHelper) getMidSectionWeights() (int, int) { } } else { if screenMode == types.SCREEN_HALF { - mainSectionWeight = 1 + if self.c.UserConfig.Gui.HalfScreenSplitMode == "vertical" { + mainSectionWeight = 2 + } else { + mainSectionWeight = 1 + } } else if screenMode == types.SCREEN_FULL { mainSectionWeight = 0 }