summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Friis <peavey@placid.dk>2008-04-27 22:51:58 +0000
committerDennis Friis <peavey@placid.dk>2008-04-27 22:51:58 +0000
commit86d441913287287baa56d6d262be9ee519840e96 (patch)
treec4574c9ad441b3d0cccfb1514436716111e3d982
parent8dabd7f5160346c8670ae95f7e713b6156e5fc48 (diff)
downloadmana-86d441913287287baa56d6d262be9ee519840e96.tar.gz
mana-86d441913287287baa56d6d262be9ee519840e96.tar.bz2
mana-86d441913287287baa56d6d262be9ee519840e96.tar.xz
mana-86d441913287287baa56d6d262be9ee519840e96.zip
Switch to use our extended ScrollArea and use adjusted width to proper calculate the grid for itemcontainer.
-rw-r--r--ChangeLog3
-rw-r--r--src/gui/inventorywindow.cpp4
-rw-r--r--src/gui/inventorywindow.h3
3 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c8a18b96..38f951a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@
width and height adjusted for any visible scrollbars.
* src/gui/itemcontainer.cpp: Fix buildup of whitespace by using
correct gridHeight and adding just 4px space to bottom.
+ * src/gui/inventorywindow.h, src/gui/inventorywindow.cpp: Switch to
+ use our extended ScrollArea and use adjusted width to proper calculate
+ the grid for itemcontainer.
2008-04-27 Dennis Friis <peavey@placid.dk>
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index 91b1ce7c..a5460f1d 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -96,6 +96,8 @@ void InventoryWindow::logic()
mWeightLabel->setCaption(
"Total Weight: " + toString(player_node->mTotalWeight) + " - "
"Maximum Weight: " + toString(player_node->mMaxWeight));
+
+ mItems->setWidth(mInvenScroll->getAdjustedWidth());
}
void InventoryWindow::action(const gcn::ActionEvent &event)
@@ -203,7 +205,7 @@ void InventoryWindow::widgetResized(const gcn::Event &event)
mInvenScroll->setSize(width - 16,
mItemDescriptionLabel->getY() - mWeightLabel->getHeight() - 18);
- mItems->setWidth(width - 16);
+ mItems->setWidth(mInvenScroll->getAdjustedWidth());
mWeightLabel->setWidth(width - 16);
}
diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h
index 1a6e01af..c016f707 100644
--- a/src/gui/inventorywindow.h
+++ b/src/gui/inventorywindow.h
@@ -33,6 +33,7 @@
class Item;
class ItemContainer;
+class ScrollArea;
/**
* Inventory dialog.
@@ -78,7 +79,7 @@ class InventoryWindow : public Window, gcn::ActionListener,
ItemContainer *mItems;
gcn::Button *mUseButton, *mDropButton;
- gcn::ScrollArea *mInvenScroll;
+ ScrollArea *mInvenScroll;
gcn::Label *mItemNameLabel;
gcn::Label *mItemDescriptionLabel;
gcn::Label *mItemEffectLabel;