summaryrefslogtreecommitdiff
path: root/src/gui/windows/shortcutwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-10 00:10:03 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-10 00:10:19 +0300
commitc03931b57fdd90151d61463bf258309683c3543b (patch)
tree212c6b1ae4f5e4161b6687f2e4f011d073ac3be1 /src/gui/windows/shortcutwindow.cpp
parent9e086637cbfbb21a5c7b4bc820e10c9c73f1a22b (diff)
downloadmv-c03931b57fdd90151d61463bf258309683c3543b.tar.gz
mv-c03931b57fdd90151d61463bf258309683c3543b.tar.bz2
mv-c03931b57fdd90151d61463bf258309683c3543b.tar.xz
mv-c03931b57fdd90151d61463bf258309683c3543b.zip
allow set smaller size for shortcuts containers.
Diffstat (limited to 'src/gui/windows/shortcutwindow.cpp')
-rw-r--r--src/gui/windows/shortcutwindow.cpp23
1 files changed, 12 insertions, 11 deletions
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);