summaryrefslogtreecommitdiff
path: root/src/gui/inventorywindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-03 05:36:14 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-03 18:35:12 +0200
commit3436558bfd7bbbe0c63a0a89330b099b7c9da7ed (patch)
treec308735397628a0e8f28452bc149dd3016869dfc /src/gui/inventorywindow.cpp
parentc595f66bc9031fd28e5146a7aaee686b4ecb9c67 (diff)
downloadmanaplus-3436558bfd7bbbe0c63a0a89330b099b7c9da7ed.tar.gz
manaplus-3436558bfd7bbbe0c63a0a89330b099b7c9da7ed.tar.bz2
manaplus-3436558bfd7bbbe0c63a0a89330b099b7c9da7ed.tar.xz
manaplus-3436558bfd7bbbe0c63a0a89330b099b7c9da7ed.zip
Add inventory filter control with only value All.
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r--src/gui/inventorywindow.cpp45
1 files changed, 31 insertions, 14 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index abb702005..8ae9c0f32 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -35,10 +35,13 @@
#include "gui/viewport.h"
#include "gui/widgets/button.h"
+#include "gui/widgets/container.h"
+#include "gui/widgets/inventoryfilter.h"
#include "gui/widgets/itemcontainer.h"
#include "gui/widgets/label.h"
#include "gui/widgets/layout.h"
#include "gui/widgets/progressbar.h"
+#include "gui/widgets/radiobutton.h"
#include "gui/widgets/scrollarea.h"
#include "net/inventoryhandler.h"
@@ -89,6 +92,12 @@ InventoryWindow::InventoryWindow(Inventory *inventory):
mSlotsLabel = new Label(_("Slots:"));
mSlotsBar = new ProgressBar(0.0f, 100, 20, Theme::PROG_INVY_SLOTS);
+ mFilter = new InventoryFilter(getWindowName(), 20, 10);
+
+ mFilterLabel = new Label(_("Filter:"));
+
+ mFilter->add("All");
+
if (isMainInventory())
{
std::string equip = _("Equip");
@@ -114,17 +123,21 @@ InventoryWindow::InventoryWindow(Inventory *inventory):
mWeightLabel = new Label(_("Weight:"));
mWeightBar = new ProgressBar(0.0f, 100, 20, Theme::PROG_WEIGHT);
- place(0, 0, mWeightLabel).setPadding(3);
+ place(0, 0, mWeightLabel, 1).setPadding(3);
place(1, 0, mWeightBar, 3);
- place(4, 0, mSlotsLabel).setPadding(3);
+ place(4, 0, mSlotsLabel, 1).setPadding(3);
place(5, 0, mSlotsBar, 2);
- place(0, 1, invenScroll, 7).setPadding(3);
- place(0, 2, mUseButton);
- place(1, 2, mUseButton2);
- place(2, 2, mDropButton);
- place(4, 2, mSplitButton);
- place(5, 2, mShopButton);
- place(6, 2, mOutfitButton);
+
+ place(0, 1, mFilterLabel, 1).setPadding(3);
+ place(1, 1, mFilter, 6).setPadding(3);
+
+ place(0, 2, invenScroll, 7).setPadding(3);
+ place(0, 3, mUseButton);
+ place(1, 3, mUseButton2);
+ place(2, 3, mDropButton);
+ place(4, 3, mSplitButton);
+ place(5, 3, mShopButton);
+ place(6, 3, mOutfitButton);
updateWeight();
}
@@ -136,14 +149,18 @@ InventoryWindow::InventoryWindow(Inventory *inventory):
place(0, 0, mSlotsLabel).setPadding(3);
place(1, 0, mSlotsBar, 3);
- place(0, 1, invenScroll, 4, 4);
- place(0, 5, mStoreButton);
- place(1, 5, mRetrieveButton);
- place(3, 5, mCloseButton);
+
+ place(0, 1, mFilterLabel, 1).setPadding(3);
+ place(1, 1, mFilter, 3).setPadding(3);
+
+ place(0, 2, invenScroll, 4, 4);
+ place(0, 6, mStoreButton);
+ place(1, 6, mRetrieveButton);
+ place(3, 6, mCloseButton);
}
Layout &layout = getLayout();
- layout.setRowHeight(1, Layout::AUTO_SET);
+ layout.setRowHeight(2, Layout::AUTO_SET);
mInventory->addInventoyListener(this);