1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-02 23:27:32 +02:00

[#2258] hide options panel when showBottom line is disabled

This commit is contained in:
Art V 2022-11-14 01:04:56 +03:00
parent dc163bfc4d
commit c53752a5f9

View File

@ -159,30 +159,26 @@ func (gui *Gui) infoSectionChildren(informationStr string, appStatus string) []*
} }
} }
result := []*boxlayout.Box{} appStatusBox := &boxlayout.Box{Window: "appStatus"}
optionsBox := &boxlayout.Box{Window: "options"}
if len(appStatus) > 0 { if !gui.c.UserConfig.Gui.ShowBottomLine {
result = append(result, optionsBox.Weight = 0
&boxlayout.Box{ appStatusBox.Weight = 1
Window: "appStatus", } else {
Size: runewidth.StringWidth(appStatus) + runewidth.StringWidth(INFO_SECTION_PADDING), optionsBox.Weight = 1
}, appStatusBox.Size = runewidth.StringWidth(INFO_SECTION_PADDING) + runewidth.StringWidth(appStatus)
)
} }
result = append(result, result := []*boxlayout.Box{appStatusBox, optionsBox}
[]*boxlayout.Box{
{ if gui.c.UserConfig.Gui.ShowBottomLine || gui.isAnyModeActive() {
Window: "options", result = append(result, &boxlayout.Box{
Weight: 1,
},
{
Window: "information", Window: "information",
// unlike appStatus, informationStr has various colors so we need to decolorise before taking the length // unlike appStatus, informationStr has various colors so we need to decolorise before taking the length
Size: runewidth.StringWidth(INFO_SECTION_PADDING) + runewidth.StringWidth(utils.Decolorise(informationStr)), Size: runewidth.StringWidth(INFO_SECTION_PADDING) + runewidth.StringWidth(utils.Decolorise(informationStr)),
}, })
}..., }
)
return result return result
} }