mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
support accordian mode i.e. expanding focused side panels
This commit is contained in:
parent
28ba142fd6
commit
35b72420ad
|
|
@ -14,6 +14,7 @@ Default path for the config file:
|
|||
scrollHeight: 2 # how many lines you scroll by
|
||||
scrollPastBottom: true # enable scrolling past the bottom
|
||||
sidePanelWidth: 0.3333 # number from 0 to 1
|
||||
expandFocusedSidePanel: false
|
||||
theme:
|
||||
lightTheme: false # For terminals with a light background
|
||||
activeBorderColor:
|
||||
|
|
|
|||
|
|
@ -246,6 +246,7 @@ func GetDefaultConfig() []byte {
|
|||
skipUnstageLineWarning: false
|
||||
skipStashWarning: true
|
||||
sidePanelWidth: 0.3333
|
||||
expandFocusedSidePanel: false
|
||||
theme:
|
||||
lightTheme: false
|
||||
activeBorderColor:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue