Skip to content

Commit c53752a

Browse files
committed
[#2258] hide options panel when showBottom line is disabled
1 parent dc163bf commit c53752a

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

pkg/gui/arrangement.go

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -159,30 +159,26 @@ func (gui *Gui) infoSectionChildren(informationStr string, appStatus string) []*
159159
}
160160
}
161161

162-
result := []*boxlayout.Box{}
162+
appStatusBox := &boxlayout.Box{Window: "appStatus"}
163+
optionsBox := &boxlayout.Box{Window: "options"}
163164

164-
if len(appStatus) > 0 {
165-
result = append(result,
166-
&boxlayout.Box{
167-
Window: "appStatus",
168-
Size: runewidth.StringWidth(appStatus) + runewidth.StringWidth(INFO_SECTION_PADDING),
169-
},
170-
)
165+
if !gui.c.UserConfig.Gui.ShowBottomLine {
166+
optionsBox.Weight = 0
167+
appStatusBox.Weight = 1
168+
} else {
169+
optionsBox.Weight = 1
170+
appStatusBox.Size = runewidth.StringWidth(INFO_SECTION_PADDING) + runewidth.StringWidth(appStatus)
171171
}
172172

173-
result = append(result,
174-
[]*boxlayout.Box{
175-
{
176-
Window: "options",
177-
Weight: 1,
178-
},
179-
{
180-
Window: "information",
181-
// unlike appStatus, informationStr has various colors so we need to decolorise before taking the length
182-
Size: runewidth.StringWidth(INFO_SECTION_PADDING) + runewidth.StringWidth(utils.Decolorise(informationStr)),
183-
},
184-
}...,
185-
)
173+
result := []*boxlayout.Box{appStatusBox, optionsBox}
174+
175+
if gui.c.UserConfig.Gui.ShowBottomLine || gui.isAnyModeActive() {
176+
result = append(result, &boxlayout.Box{
177+
Window: "information",
178+
// unlike appStatus, informationStr has various colors so we need to decolorise before taking the length
179+
Size: runewidth.StringWidth(INFO_SECTION_PADDING) + runewidth.StringWidth(utils.Decolorise(informationStr)),
180+
})
181+
}
186182

187183
return result
188184
}

0 commit comments

Comments
 (0)