diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-04-02 17:05:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-04-02 17:05:22 +0300 |
commit | 3279c64d25124dbe759f7ba4fffe5554c3dd9e1e (patch) | |
tree | caa87efca43cf2d959565f472ba039c2f2c48bb0 /src/gui | |
parent | ef0f7af63a5e1bd73fb34c601f996e7aadf848c0 (diff) | |
download | manaplus-3279c64d25124dbe759f7ba4fffe5554c3dd9e1e.tar.gz manaplus-3279c64d25124dbe759f7ba4fffe5554c3dd9e1e.tar.bz2 manaplus-3279c64d25124dbe759f7ba4fffe5554c3dd9e1e.tar.xz manaplus-3279c64d25124dbe759f7ba4fffe5554c3dd9e1e.zip |
Improve isVisible usage.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/checkbox.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/radiobutton.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/tabbedarea.cpp | 2 | ||||
-rw-r--r-- | src/gui/windowmenu.cpp | 6 | ||||
-rw-r--r-- | src/gui/windows/chatwindow.cpp | 22 | ||||
-rw-r--r-- | src/gui/windows/ministatuswindow.cpp | 6 |
7 files changed, 21 insertions, 25 deletions
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<Button*>(*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<Button *const>(*it); if (!btn) continue; - if (btn->isVisible()) + if (btn->isVisibleLocal()) { btn->setPosition(x, mPadding); add(btn); @@ -396,7 +396,7 @@ void WindowMenu::saveButtons() const FOR_EACH (std::vector <Button*>::const_iterator, it, mButtons) { const Button *const btn = dynamic_cast<const Button *const>(*it); - if (btn && !btn->isVisible()) + if (btn && !btn->isVisibleLocal()) { config.setValue("windowmenu" + toString(i), btn->getActionEventId()); diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 8d1d3e046..05ee56356 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -314,14 +314,10 @@ void ChatWindow::loadGMCommands() void ChatWindow::updateTabsMargin() { - if (mColorPicker->isVisible()) - { + if (mColorPicker->isVisibleLocal()) mChatTabs->setRightMargin(mColorPicker->getWidth() + 16 + 8); - } else - { mChatTabs->setRightMargin(8); - } } void ChatWindow::adjustTabSize() @@ -339,7 +335,7 @@ void ChatWindow::adjustTabSize() mChatInput->setPosition(frame, y); mChatTabs->setWidth(awFrame2); const int height = ah - frame2 - (inputHeight + frame2); - if (mChatInput->isVisible() || !config.getBoolValue("hideChatInput")) + if (mChatInput->isVisibleLocal() || !config.getBoolValue("hideChatInput")) mChatTabs->setHeight(height); else mChatTabs->setHeight(height + inputHeight); @@ -362,7 +358,7 @@ void ChatWindow::adjustTabSize() y -= 2; } mChatInput->setWidth(w); - mChatButton->setVisible(mChatInput->isVisible()); + mChatButton->setVisible(mChatInput->isVisibleLocal()); mChatButton->setPosition(x, y); } else @@ -514,7 +510,7 @@ void ChatWindow::action(const ActionEvent &event) { if (emoteWindow) { - if (emoteWindow->isVisible()) + if (emoteWindow->isVisibleLocal()) emoteWindow->hide(); else emoteWindow->show(); @@ -553,7 +549,7 @@ void ChatWindow::action(const ActionEvent &event) } } - if (mColorPicker && mColorPicker->isVisible() + if (mColorPicker && mColorPicker->isVisibleLocal() != config.getBoolValue("showChatColorsList")) { mColorPicker->setVisible(config.getBoolValue( @@ -839,12 +835,12 @@ void ChatWindow::keyPressed(KeyEvent &event) return; } else if (actionId == static_cast<int>(Input::KEY_GUI_CANCEL) && - mChatInput->isVisible()) + mChatInput->isVisibleLocal()) { mChatInput->processVisible(false); } else if (actionId == static_cast<int>(Input::KEY_CHAT_PREV_HISTORY) && - mChatInput->isVisible()) + mChatInput->isVisibleLocal()) { const ChatTab *const tab = getFocused(); if (tab && tab->hasRows()) @@ -876,7 +872,7 @@ void ChatWindow::keyPressed(KeyEvent &event) } } else if (actionId == static_cast<int>(Input::KEY_CHAT_NEXT_HISTORY) && - mChatInput->isVisible()) + mChatInput->isVisibleLocal()) { const ChatTab *const tab = getFocused(); if (tab && tab->hasRows()) @@ -915,7 +911,7 @@ void ChatWindow::keyPressed(KeyEvent &event) { if (emoteWindow) { - if (emoteWindow->isVisible()) + if (emoteWindow->isVisibleLocal()) emoteWindow->hide(); else emoteWindow->show(); diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index 885ea619b..93a6a6a10 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -162,7 +162,7 @@ MiniStatusWindow::~MiniStatusWindow() ProgressBar *bar = *it; if (!bar) continue; - if (!bar->isVisible()) + if (!bar->isVisibleLocal()) delete bar; } mBars.clear(); @@ -200,7 +200,7 @@ void MiniStatusWindow::updateBars() ProgressBar *const bar = *it; if (!bar) continue; - if (bar->isVisible()) + if (bar->isVisibleLocal()) { bar->setPosition(x, 0); add(bar); @@ -507,7 +507,7 @@ void MiniStatusWindow::saveBars() const FOR_EACH (ProgressBarVectorCIter, it, mBars) { const ProgressBar *const bar = *it; - if (!bar->isVisible()) + if (!bar->isVisibleLocal()) { config.setValue("ministatus" + toString(i), bar->getActionEventId()); |