From ad9036cb9026091ae0d5b0150513a907e092613f Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 28 Mar 2009 01:44:25 +0100 Subject: Fixed the wrapping of item and emoticon shortcut windows Take into account incomplete rows. --- src/gui/shortcutcontainer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gui') 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 -- cgit v1.2.3-70-g09d2