summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-28 01:44:25 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-28 01:48:06 +0100
commitad9036cb9026091ae0d5b0150513a907e092613f (patch)
tree82edd49cddc3aa7dc35a5f9c888bff3d6779aec7
parent38f30a158a73bf2e6481d32e90a85684e4542fdf (diff)
downloadmana-ad9036cb9026091ae0d5b0150513a907e092613f.tar.gz
mana-ad9036cb9026091ae0d5b0150513a907e092613f.tar.bz2
mana-ad9036cb9026091ae0d5b0150513a907e092613f.tar.xz
mana-ad9036cb9026091ae0d5b0150513a907e092613f.zip
Fixed the wrapping of item and emoticon shortcut windows
Take into account incomplete rows.
-rw-r--r--src/gui/shortcutcontainer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/shortcutcontainer.cpp b/src/gui/shortcutcontainer.cpp
index 9067e921..228a484e 100644
--- a/src/gui/shortcutcontainer.cpp
+++ b/src/gui/shortcutcontainer.cpp
@@ -42,12 +42,12 @@ void ShortcutContainer::widgetResized(const gcn::Event &event)
if (mGridWidth < 1)
mGridWidth = 1;
- setHeight((mMaxItems / mGridWidth) * mBoxHeight);
+ mGridHeight = mMaxItems / mGridWidth;
- mGridHeight = getHeight() / mBoxHeight;
+ if (mMaxItems % mGridWidth != 0 || mGridHeight < 1)
+ ++mGridHeight;
- if (mGridHeight < 1)
- mGridHeight = 1;
+ setHeight(mGridHeight * mBoxHeight);
}
int ShortcutContainer::getIndexFromGrid(int pointX, int pointY) const