mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-21 04:46:29 +03:00
Extract the size of the info section into a function
The size of the side panels will depend on the height of the screen without the info section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
56fa4350c7
commit
f9b958441d
1 file changed
+12
-10
@@ -141,15 +141,6 @@ func GetWindowDimensions(args WindowArrangementArgs) map[string]boxlayout.Dimens
|
||||
sidePanelsDirection = boxlayout.ROW
|
||||
}
|
||||
|
||||
showInfoSection := args.UserConfig.Gui.ShowBottomLine ||
|
||||
args.InSearchPrompt ||
|
||||
args.IsAnyModeActive ||
|
||||
args.AppStatus != ""
|
||||
infoSectionSize := 0
|
||||
if showInfoSection {
|
||||
infoSectionSize = 1
|
||||
}
|
||||
|
||||
root := &boxlayout.Box{
|
||||
Direction: boxlayout.ROW,
|
||||
Children: []*boxlayout.Box{
|
||||
@@ -171,7 +162,7 @@ func GetWindowDimensions(args WindowArrangementArgs) map[string]boxlayout.Dimens
|
||||
},
|
||||
{
|
||||
Direction: boxlayout.COLUMN,
|
||||
Size: infoSectionSize,
|
||||
Size: infoSectionSize(args),
|
||||
Children: infoSectionChildren(args),
|
||||
},
|
||||
},
|
||||
@@ -295,6 +286,17 @@ func getMidSectionWeights(args WindowArrangementArgs) (int, int) {
|
||||
return sideSectionWeight, mainSectionWeight
|
||||
}
|
||||
|
||||
func infoSectionSize(args WindowArrangementArgs) int {
|
||||
showInfoSection := args.UserConfig.Gui.ShowBottomLine ||
|
||||
args.InSearchPrompt ||
|
||||
args.IsAnyModeActive ||
|
||||
args.AppStatus != ""
|
||||
if showInfoSection {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func infoSectionChildren(args WindowArrangementArgs) []*boxlayout.Box {
|
||||
if args.InSearchPrompt {
|
||||
return []*boxlayout.Box{
|
||||
|
||||
Reference in new issue
Block a user