Skip to content

Commit e953659

Browse files
Merge pull request #2273 from artvi/fix/show_loading_state_when_bottomline_disabled
2 parents b33ec5a + c53752a commit e953659

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

pkg/gui/app_status_manager.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ func (m *statusManager) getStatusString() string {
8282
return topStatus.message
8383
}
8484

85+
func (m *statusManager) showStatus() bool {
86+
return len(m.statuses) > 0
87+
}
88+
8589
func (gui *Gui) toast(message string) {
8690
gui.statusManager.addToastStatus(message)
8791

pkg/gui/arrangement.go

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func (gui *Gui) getWindowDimensions(informationStr string, appStatus string) map
3131

3232
extrasWindowSize := gui.getExtrasWindowSize(height)
3333

34-
showInfoSection := gui.c.UserConfig.Gui.ShowBottomLine || (gui.State.Searching.isSearching || gui.isAnyModeActive())
34+
showInfoSection := gui.c.UserConfig.Gui.ShowBottomLine || gui.State.Searching.isSearching || gui.isAnyModeActive() || gui.statusManager.showStatus()
3535
infoSectionSize := 0
3636
if showInfoSection {
3737
infoSectionSize = 1
@@ -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)