diff options
-rw-r--r-- | src/gui/ministatuswindow.cpp | 4 | ||||
-rw-r--r-- | src/gui/popupmenu.cpp | 22 |
2 files changed, 24 insertions, 2 deletions
diff --git a/src/gui/ministatuswindow.cpp b/src/gui/ministatuswindow.cpp index 5e4559c9c..70ebe7e01 100644 --- a/src/gui/ministatuswindow.cpp +++ b/src/gui/ministatuswindow.cpp @@ -436,13 +436,15 @@ void MiniStatusWindow::loadBars() mMoneyBar->setVisible(false); if (mArrowsBar) mArrowsBar->setVisible(false); + if (mStatusBar) + mStatusBar->setVisible(false); return; } for (int f = 0; f < 10; f ++) { std::string str = config.getValue("ministatus" + toString(f), ""); - if (str == "" || str == "status bar") + if (str == "") continue; ProgressBar *const bar = mBarNames[str]; if (!bar) diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 6bd384132..e80158227 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -1951,11 +1951,31 @@ void PopupMenu::showPopup(const int x, const int y, const ProgressBar *const b) mBrowserBox->clearRows(); std::vector <ProgressBar*> bars = miniStatusWindow->getBars(); + ProgressBar *onlyBar = nullptr; + int cnt = 0; + + // search for alone visible bar + for (std::vector <ProgressBar*>::const_iterator it = bars.begin(), + it_end = bars.end(); it != it_end; ++it) + { + ProgressBar *const bar = *it; + if (!bar) + continue; + + if (bar->isVisible()) + { + cnt ++; + onlyBar = bar; + } + } + if (cnt > 1) + onlyBar = nullptr; + for (std::vector <ProgressBar*>::const_iterator it = bars.begin(), it_end = bars.end(); it != it_end; ++it) { ProgressBar *const bar = *it; - if (!bar || bar->getActionEventId() == "status bar") + if (!bar || bar == onlyBar) continue; if (bar->isVisible()) |