summaryrefslogtreecommitdiff
path: root/src/gui/inventorywindow.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-19 15:22:57 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-19 15:29:51 +0200
commite7f9c983dd7a8d2aeb4b14e5621cef89ecc398f6 (patch)
treed2206a3544acfba5598df229b15e890b7450f1c8 /src/gui/inventorywindow.cpp
parent21d85f8726ad4a15702005247e5241a2056cbbc8 (diff)
downloadmana-e7f9c983dd7a8d2aeb4b14e5621cef89ecc398f6.tar.gz
mana-e7f9c983dd7a8d2aeb4b14e5621cef89ecc398f6.tar.bz2
mana-e7f9c983dd7a8d2aeb4b14e5621cef89ecc398f6.tar.xz
mana-e7f9c983dd7a8d2aeb4b14e5621cef89ecc398f6.zip
Made ItemContainer wrap items depending on its width again
This is instead of taking a fixed number of rows and columns. The inventory and trade window are now resizable again. Other smaller changes: * Don't use bold font for the labels in the item container * Changed "(Eq)" back to "Eq." * Removed the ugly grid lines
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r--src/gui/inventorywindow.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index a808945e..50b0bd78 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -54,10 +54,12 @@ InventoryWindow::InventoryWindow(int invSize):
mItemDesc(false)
{
setWindowName("Inventory");
- setResizable(false);
+ setResizable(true);
setCloseButton(true);
setDefaultSize(387, 307, ImageRect::CENTER);
+ setMinWidth(316);
+ setMinHeight(179);
addKeyListener(this);
std::string longestUseString = getFont()->getWidth(_("Equip")) >
@@ -74,14 +76,14 @@ InventoryWindow::InventoryWindow(int invSize):
mDropButton = new Button(_("Drop"), "drop", this);
#ifdef TMWSERV_SUPPORT
mSplitButton = new Button(_("Split"), "split", this);
- mItems = new ItemContainer(player_node->getInventory(), 10, 5);
+ mItems = new ItemContainer(player_node->getInventory());
#else
- mItems = new ItemContainer(player_node->getInventory(), 10, 10);
+ mItems = new ItemContainer(player_node->getInventory());
#endif
mItems->addSelectionListener(this);
- mInvenScroll = new ScrollArea(mItems);
- mInvenScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
+ gcn::ScrollArea *invenScroll = new ScrollArea(mItems);
+ invenScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
mTotalWeight = -1;
mMaxWeight = -1;
@@ -97,7 +99,7 @@ InventoryWindow::InventoryWindow(int invSize):
place(1, 0, mWeightBar, 3);
place(4, 0, mSlotsLabel).setPadding(3);
place(5, 0, mSlotsBar, 2);
- place(0, 1, mInvenScroll, 7).setPadding(3);
+ place(0, 1, invenScroll, 7).setPadding(3);
place(0, 2, mUseButton);
place(1, 2, mDropButton);
#ifdef TMWSERV_SUPPORT