From 3279c64d25124dbe759f7ba4fffe5554c3dd9e1e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 2 Apr 2014 17:05:22 +0300 Subject: Improve isVisible usage. --- src/being/being.cpp | 2 +- src/gui/popups/popupmenu.cpp | 6 +++--- src/gui/widgets/checkbox.cpp | 2 +- src/gui/widgets/radiobutton.cpp | 2 +- src/gui/widgets/tabbedarea.cpp | 2 +- src/gui/windowmenu.cpp | 6 +++--- src/gui/windows/chatwindow.cpp | 22 +++++++++------------- src/gui/windows/ministatuswindow.cpp | 6 +++--- 8 files changed, 22 insertions(+), 26 deletions(-) diff --git a/src/being/being.cpp b/src/being/being.cpp index be4d8b903..9f99a2ab8 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1668,7 +1668,7 @@ void Being::drawSpeech(const int offsetX, const int offsetY) // Draw speech above this being if (mSpeechTime == 0) { - if (mSpeechBubble->isVisible()) + if (mSpeechBubble->isVisibleLocal()) mSpeechBubble->setVisible(false); } else if (mSpeechTime > 0 && (speech == NAME_IN_BUBBLE || diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 330df1a6c..504ad6426 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -2164,7 +2164,7 @@ void PopupMenu::showPopup(const int x, const int y, Button *const button) if (!btn || btn->getActionEventId() == "SET") continue; - if (btn->isVisible()) + if (btn->isVisibleLocal()) { mBrowserBox->addRow(strprintf("@@hide button_%s|%s %s (%s)@@", // TRANSLATORS: popup menu item @@ -2209,7 +2209,7 @@ void PopupMenu::showPopup(const int x, const int y, const ProgressBar *const b) if (!bar) continue; - if (bar->isVisible()) + if (bar->isVisibleLocal()) { cnt ++; onlyBar = bar; @@ -2225,7 +2225,7 @@ void PopupMenu::showPopup(const int x, const int y, const ProgressBar *const b) if (!bar || bar == onlyBar) continue; - if (bar->isVisible()) + if (bar->isVisibleLocal()) { mBrowserBox->addRow(strprintf("@@hide bar_%s|%s %s@@", // TRANSLATORS: popup menu item diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp index 06dcecab0..765ff13ec 100644 --- a/src/gui/widgets/checkbox.cpp +++ b/src/gui/widgets/checkbox.cpp @@ -189,7 +189,7 @@ void CheckBox::drawBox(Graphics *const graphics) const ImageRect &rect = mSkin->getBorder(); int index = 0; - if (mEnabled && isVisible()) + if (mEnabled && mVisible) { if (mSelected) { diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp index 643517f77..27be9434b 100644 --- a/src/gui/widgets/radiobutton.cpp +++ b/src/gui/widgets/radiobutton.cpp @@ -176,7 +176,7 @@ void RadioButton::drawBox(Graphics* graphics) const ImageRect &rect = mSkin->getBorder(); int index = 0; - if (mEnabled && isVisible()) + if (mEnabled && mVisible) { if (mSelected) { diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index cf55fa10b..cd439a95a 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -570,7 +570,7 @@ void TabbedArea::adjustTabPositions() maxTabHeight = tab->getHeight(); } - int x = (mEnableScrollButtons && mArrowButton[0]->isVisible()) + int x = (mEnableScrollButtons && mArrowButton[0]->isVisibleLocal()) ? mArrowButton[0]->getWidth() : 0; for (size_t i = mTabScrollIndex; i < sz; ++i) { diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp index 910bba705..c3b52ed59 100644 --- a/src/gui/windowmenu.cpp +++ b/src/gui/windowmenu.cpp @@ -185,7 +185,7 @@ WindowMenu::~WindowMenu() Button *const btn = dynamic_cast(*it); if (!btn) continue; - if (!btn->isVisible()) + if (!btn->isVisibleLocal()) delete btn; } delete_all(mButtonTexts); @@ -328,7 +328,7 @@ void WindowMenu::updateButtons() Button *const btn = dynamic_cast