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/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 +++--- 7 files changed, 21 insertions(+), 25 deletions(-) (limited to 'src/gui') 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