From c03931b57fdd90151d61463bf258309683c3543b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 10 Dec 2013 00:10:03 +0300 Subject: allow set smaller size for shortcuts containers. --- src/gui/windows/shortcutwindow.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/gui') diff --git a/src/gui/windows/shortcutwindow.cpp b/src/gui/windows/shortcutwindow.cpp index 189145ca7..1ae82a781 100644 --- a/src/gui/windows/shortcutwindow.cpp +++ b/src/gui/windows/shortcutwindow.cpp @@ -77,19 +77,22 @@ ShortcutWindow::ShortcutWindow(const std::string &title, setupWindow->registerWindowForReset(this); const int border = SCROLL_PADDING * 2 + getPadding() * 2; - setMinWidth(mItems->getBoxWidth() + border); - setMinHeight(mItems->getBoxHeight() + border); - setMaxWidth(mItems->getBoxWidth() * mItems->getMaxItems() + border); - setMaxHeight(mItems->getBoxHeight() * mItems->getMaxItems() + border); + const int bw = mItems->getBoxWidth(); + const int bh = mItems->getBoxHeight(); + const int maxItems = mItems->getMaxItems(); + setMinWidth(32); + setMinHeight(32); + setMaxWidth(bw * maxItems + border); + setMaxHeight(bh * maxItems + border); if (width == 0) - width = mItems->getBoxWidth() + border; + width = bw + border; if (height == 0) - height = (mItems->getBoxHeight() * mItems->getMaxItems()) + border; + height = bh * maxItems + border; setDefaultSize(width, height, ImageRect::LOWER_RIGHT); - mBoxesWidth += mItems->getBoxWidth() + border; + mBoxesWidth += bw + border; mScrollArea->setPosition(SCROLL_PADDING, SCROLL_PADDING); mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); @@ -127,13 +130,11 @@ ShortcutWindow::ShortcutWindow(const std::string &title, if (setupWindow) setupWindow->registerWindowForReset(this); - const int border = SCROLL_PADDING * 2 + getPadding() * 2; - if (width && height) setDefaultSize(width, height, ImageRect::LOWER_RIGHT); - setMinWidth(32 + border); - setMinHeight(32 + border); + setMinWidth(32); + setMinHeight(32); place(0, 0, mTabs, 5, 5); -- cgit v1.2.3-70-g09d2