summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pkg/gui/app_status_manager.go4
-rw-r--r--pkg/gui/arrangement.go40
2 files changed, 22 insertions, 22 deletions
diff --git a/pkg/gui/app_status_manager.go b/pkg/gui/app_status_manager.go
index c2d72c5ac..097a19438 100644
--- a/pkg/gui/app_status_manager.go
+++ b/pkg/gui/app_status_manager.go
@@ -82,6 +82,10 @@ func (m *statusManager) getStatusString() string {
return topStatus.message
}
+func (m *statusManager) showStatus() bool {
+ return len(m.statuses) > 0
+}
+
func (gui *Gui) toast(message string) {
gui.statusManager.addToastStatus(message)
diff --git a/pkg/gui/arrangement.go b/pkg/gui/arrangement.go
index ecff17893..ac6f2d9c1 100644
--- a/pkg/gui/arrangement.go
+++ b/pkg/gui/arrangement.go
@@ -31,7 +31,7 @@ func (gui *Gui) getWindowDimensions(informationStr string, appStatus string) map
extrasWindowSize := gui.getExtrasWindowSize(height)
- showInfoSection := gui.c.UserConfig.Gui.ShowBottomLine || (gui.State.Searching.isSearching || gui.isAnyModeActive())
+ showInfoSection := gui.c.UserConfig.Gui.ShowBottomLine || gui.State.Searching.isSearching || gui.isAnyModeActive() || gui.statusManager.showStatus()
infoSectionSize := 0
if showInfoSection {
infoSectionSize = 1
@@ -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 {
- result = append(result,
- &boxlayout.Box{
- Window: "appStatus",
- Size: runewidth.StringWidth(appStatus) + runewidth.StringWidth(INFO_SECTION_PADDING),
- },
- )
+ if !gui.c.UserConfig.Gui.ShowBottomLine {
+ optionsBox.Weight = 0
+ appStatusBox.Weight = 1
+ } else {
+ optionsBox.Weight = 1
+ appStatusBox.Size = runewidth.StringWidth(INFO_SECTION_PADDING) + runewidth.StringWidth(appStatus)
}
- result = append(result,
- []*boxlayout.Box{
- {
- Window: "options",
- Weight: 1,
- },
- {
- Window: "information",
- // 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)),
- },
- }...,
- )
+ result := []*boxlayout.Box{appStatusBox, optionsBox}
+
+ if gui.c.UserConfig.Gui.ShowBottomLine || gui.isAnyModeActive() {
+ result = append(result, &boxlayout.Box{
+ Window: "information",
+ // 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)),
+ })
+ }
return result
}