summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-06 00:08:38 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-06 00:08:38 +0300
commit863ef6dc13fb3a7fb434ce173a84253f0c4559c5 (patch)
tree8e27d0ae9522e61c6805375cec35014bada1c1d6
parent44c92542331ea57553978e55585b5687d7034654 (diff)
downloadmanaplus-863ef6dc13fb3a7fb434ce173a84253f0c4559c5.tar.gz
manaplus-863ef6dc13fb3a7fb434ce173a84253f0c4559c5.tar.bz2
manaplus-863ef6dc13fb3a7fb434ce173a84253f0c4559c5.tar.xz
manaplus-863ef6dc13fb3a7fb434ce173a84253f0c4559c5.zip
Allow hide yellow bar.
By default in new configurations yellow bar is hidden.
-rw-r--r--src/gui/ministatuswindow.cpp4
-rw-r--r--src/gui/popupmenu.cpp22
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())