1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-21 22:43:27 +02:00

allow configuring side panel width

This commit is contained in:
Jesse Duffield 2020-03-04 00:08:34 +11:00
parent 0abd7ad6be
commit 31e201ca52
3 changed files with 5 additions and 1 deletions

View File

@ -12,6 +12,7 @@ Default path for the config file:
# stuff relating to the UI # stuff relating to the UI
scrollHeight: 2 # how many lines you scroll by scrollHeight: 2 # how many lines you scroll by
scrollPastBottom: true # enable scrolling past the bottom scrollPastBottom: true # enable scrolling past the bottom
sidePanelWidth: 0.3333 # number from 0 to 1
theme: theme:
lightTheme: false # For terminals with a light background lightTheme: false # For terminals with a light background
activeBorderColor: activeBorderColor:

View File

@ -244,6 +244,7 @@ func GetDefaultConfig() []byte {
scrollPastBottom: true scrollPastBottom: true
mouseEvents: true mouseEvents: true
skipUnstageLineWarning: false skipUnstageLineWarning: false
sidePanelWidth: 0.3333
theme: theme:
lightTheme: false lightTheme: false
activeBorderColor: activeBorderColor:

View File

@ -520,11 +520,13 @@ func (gui *Gui) layout(g *gocui.Gui) error {
_, _ = g.SetViewOnBottom("limit") _, _ = g.SetViewOnBottom("limit")
g.DeleteView("limit") g.DeleteView("limit")
sidePanelWidthRatio := gui.Config.GetUserConfig().GetFloat64("gui.sidePanelWidth")
textColor := theme.GocuiDefaultTextColor textColor := theme.GocuiDefaultTextColor
var leftSideWidth int var leftSideWidth int
switch gui.State.ScreenMode { switch gui.State.ScreenMode {
case SCREEN_NORMAL: case SCREEN_NORMAL:
leftSideWidth = width / 3 leftSideWidth = int(float64(width) * sidePanelWidthRatio)
case SCREEN_HALF: case SCREEN_HALF:
leftSideWidth = width / 2 leftSideWidth = width / 2
case SCREEN_FULL: case SCREEN_FULL: