diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-10-02 17:12:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-10-02 17:12:54 +0300 |
commit | 8dcb524443a82506b522344f3d4353769f51883c (patch) | |
tree | ce7a71d2cf1c6debeca31b4f92c7cb2871870722 /src | |
parent | ab2c75888d63977e2a24793ce96c6adcd0eb7e0e (diff) | |
download | manaplus-8dcb524443a82506b522344f3d4353769f51883c.tar.gz manaplus-8dcb524443a82506b522344f3d4353769f51883c.tar.bz2 manaplus-8dcb524443a82506b522344f3d4353769f51883c.tar.xz manaplus-8dcb524443a82506b522344f3d4353769f51883c.zip |
bit cleanup tabbedarea.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/tabbedarea.cpp | 11 | ||||
-rw-r--r-- | src/gui/widgets/tabbedarea.h | 4 | ||||
-rw-r--r-- | src/gui/windows/chatwindow.cpp | 6 | ||||
-rw-r--r-- | src/gui/windows/socialwindow.cpp | 4 |
4 files changed, 9 insertions, 16 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 44b2ea8d8..721e0b653 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -235,7 +235,7 @@ bool TabbedArea::isTabSelected(const Tab *const tab) const return mSelectedTab == tab; } -void TabbedArea::setSelectedTab(const unsigned int index) +void TabbedArea::setSelectedTabByIndex(const unsigned int index) { if (index >= mTabs.size()) return; @@ -292,7 +292,7 @@ void TabbedArea::removeTab(Tab *const tab) } else { - setSelectedTabByPos(tabIndexToBeSelected); + setSelectedTabByIndex(tabIndexToBeSelected); } adjustSize(); @@ -376,11 +376,6 @@ void TabbedArea::setSelectedTabByName(const std::string &name) } } -void TabbedArea::setSelectedTabByPos(const int tab) -{ - setSelectedTab(tab); -} - void TabbedArea::widgetResized(const gcn::Event &event A_UNUSED) { adjustSize(); @@ -631,7 +626,7 @@ void TabbedArea::removeAll(const bool del) { if (getSelectedTabIndex() != -1) { - setSelectedTabByPos(static_cast<unsigned int>(0)); + setSelectedTabByIndex(static_cast<unsigned int>(0)); } while (getNumberOfTabs() > 0) { diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index dd74405fc..6b20d59f4 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -119,7 +119,7 @@ class TabbedArea final : public Widget2, void setSelectedTab(Tab *const tab); - void setSelectedTab(const unsigned int index); + void setSelectedTabByIndex(const unsigned int index); int getSelectedTabIndex() const A_WARN_UNUSED; @@ -134,8 +134,6 @@ class TabbedArea final : public Widget2, void adjustSize(); - void setSelectedTabByPos(const int tab); - void setSelectedTabByName(const std::string &name); void widgetResized(const gcn::Event &event) override; diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 47627e664..ee68e53c1 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -418,7 +418,7 @@ void ChatWindow::prevTab() tab = mChatTabs->getNumberOfTabs(); tab--; - mChatTabs->setSelectedTabByPos(tab); + mChatTabs->setSelectedTabByIndex(tab); } void ChatWindow::nextTab() @@ -432,7 +432,7 @@ void ChatWindow::nextTab() if (tab == mChatTabs->getNumberOfTabs()) tab = 0; - mChatTabs->setSelectedTabByPos(tab); + mChatTabs->setSelectedTabByIndex(tab); } void ChatWindow::closeTab() const @@ -454,7 +454,7 @@ void ChatWindow::closeTab() const void ChatWindow::defaultTab() { if (mChatTabs) - mChatTabs->setSelectedTabByPos(static_cast<unsigned>(0)); + mChatTabs->setSelectedTabByIndex(static_cast<unsigned>(0)); } void ChatWindow::action(const gcn::ActionEvent &event) diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp index 2779c497b..23251f427 100644 --- a/src/gui/windows/socialwindow.cpp +++ b/src/gui/windows/socialwindow.cpp @@ -1806,7 +1806,7 @@ void SocialWindow::nextTab() if (tab == mTabs->getNumberOfTabs()) tab = 0; - mTabs->setSelectedTabByPos(tab); + mTabs->setSelectedTabByIndex(tab); } void SocialWindow::prevTab() @@ -1820,7 +1820,7 @@ void SocialWindow::prevTab() tab = mTabs->getNumberOfTabs(); tab--; - mTabs->setSelectedTabByPos(tab); + mTabs->setSelectedTabByIndex(tab); } void SocialWindow::updateAttackFilter() |