diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-01-11 17:25:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-01-11 17:25:45 +0300 |
commit | a3c5d6cc7d6f821b31342de3a429996f2775d15e (patch) | |
tree | e4cf05880a95baaa689ac52da0ce5120408931c0 /src | |
parent | 2791fac578c27f6dafc8d5fcebc7f281424285d6 (diff) | |
download | plus-a3c5d6cc7d6f821b31342de3a429996f2775d15e.tar.gz plus-a3c5d6cc7d6f821b31342de3a429996f2775d15e.tar.bz2 plus-a3c5d6cc7d6f821b31342de3a429996f2775d15e.tar.xz plus-a3c5d6cc7d6f821b31342de3a429996f2775d15e.zip |
Simplify AddButton method in WidgetGroup class.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/tabs/setup_input.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/widgetgroup.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/widgetgroup.h | 5 | ||||
-rw-r--r-- | src/gui/windows/equipmentwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/inventorywindow.cpp | 2 |
5 files changed, 4 insertions, 13 deletions
diff --git a/src/gui/widgets/tabs/setup_input.cpp b/src/gui/widgets/tabs/setup_input.cpp index c13c3d1ce..22dcc9e18 100644 --- a/src/gui/widgets/tabs/setup_input.cpp +++ b/src/gui/widgets/tabs/setup_input.cpp @@ -108,7 +108,7 @@ Setup_Input::Setup_Input(const Widget2 *const widget) : int k = 0; while (pages[k]) { - mTabs->addButton(gettext(pages[k]), pages[k]); + mTabs->addButton(gettext(pages[k]), pages[k], false); k ++; } diff --git a/src/gui/widgets/widgetgroup.cpp b/src/gui/widgets/widgetgroup.cpp index 3cddc625a..d54e3074a 100644 --- a/src/gui/widgets/widgetgroup.cpp +++ b/src/gui/widgets/widgetgroup.cpp @@ -38,12 +38,6 @@ WidgetGroup::WidgetGroup(const Widget2 *const widget, addWidgetListener(this); } -void WidgetGroup::addButton(const std::string &tag, - const bool pressed) -{ - addButton(tag, tag, pressed); -} - void WidgetGroup::addButton(const std::string &restrict text, const std::string &restrict tag, const bool pressed) diff --git a/src/gui/widgets/widgetgroup.h b/src/gui/widgets/widgetgroup.h index ef6c26629..1341688c5 100644 --- a/src/gui/widgets/widgetgroup.h +++ b/src/gui/widgets/widgetgroup.h @@ -35,12 +35,9 @@ class WidgetGroup notfinal : public Container, public: A_DELETE_COPY(WidgetGroup) - virtual void addButton(const std::string &tag, - const bool pressed = false); - virtual void addButton(const std::string &restrict text, const std::string &restrict tag, - const bool pressed = false); + const bool pressed); void action(const ActionEvent &event) override; diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index e50b0c488..ae438dc10 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -763,6 +763,6 @@ int EquipmentWindow::addPage(const std::string &name) for (int f = 0; f < BOX_COUNT; f ++) boxes.push_back(nullptr); - mTabs->addButton(name); + mTabs->addButton(name, name, false); return static_cast<int>(mPages.size()) - 1; } diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index 25e087ec1..c8702a51f 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -164,7 +164,7 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) : StringVect tags = ItemDB::getTags(); const size_t sz = tags.size(); for (size_t f = 0; f < sz; f ++) - mFilter->addButton(tags[f]); + mFilter->addButton(tags[f], tags[f], false); if (isMainInventory()) { |