summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/inventoryfilter.cpp9
-rw-r--r--src/gui/widgets/inventoryfilter.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/widgets/inventoryfilter.cpp b/src/gui/widgets/inventoryfilter.cpp
index aa2f2a5e4..7de7457ea 100644
--- a/src/gui/widgets/inventoryfilter.cpp
+++ b/src/gui/widgets/inventoryfilter.cpp
@@ -33,10 +33,15 @@ InventoryFilter::InventoryFilter(std::string group, int height, int spacing):
void InventoryFilter::add(std::string tag)
{
- if (tag.empty())
+ add(tag, tag);
+}
+
+void InventoryFilter::add(std::string text, std::string tag)
+{
+ if (text.empty() || tag.empty())
return;
- RadioButton *radio = new RadioButton(tag, mGroup, mCount == 0);
+ RadioButton *radio = new RadioButton(text, mGroup, mCount == 0);
radio->adjustSize();
radio->setActionEventId(mActionEventId + tag);
radio->addActionListener(this);
diff --git a/src/gui/widgets/inventoryfilter.h b/src/gui/widgets/inventoryfilter.h
index 42f51c895..aa71bb419 100644
--- a/src/gui/widgets/inventoryfilter.h
+++ b/src/gui/widgets/inventoryfilter.h
@@ -40,6 +40,8 @@ class InventoryFilter : public HorizontContainer, public gcn::ActionListener
void add(std::string tag);
+ void add(std::string text, std::string tag);
+
void action(const gcn::ActionEvent &event);
private: