summaryrefslogtreecommitdiff
path: root/src/gui/shortcutwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/shortcutwindow.cpp')
-rw-r--r--src/gui/shortcutwindow.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/shortcutwindow.cpp b/src/gui/shortcutwindow.cpp
index 2cffbb81..c33fcf01 100644
--- a/src/gui/shortcutwindow.cpp
+++ b/src/gui/shortcutwindow.cpp
@@ -49,10 +49,13 @@ ShortcutWindow::ShortcutWindow(const std::string &title,
const int border = (getPadding() + content->getFrameSize()) * 2;
setMinWidth(content->getBoxWidth() + border);
setMinHeight(content->getBoxHeight() + border + GRAB_MARGIN);
- setMaxWidth(content->getBoxWidth() * content->getMaxItems() + border);
- setMaxHeight(content->getBoxHeight() * content->getMaxItems() + border + GRAB_MARGIN);
- setDefaultSize(getMinWidth(), getMaxHeight(), ImageRect::LOWER_RIGHT);
+ const int maxContentWidth = content->getBoxWidth() * content->getMaxItems();
+ const int maxContentHeight = content->getBoxHeight() * content->getMaxItems();
+ setMaxWidth(std::max(getMinWidth(), maxContentWidth + border));
+ setMaxHeight(std::max(getMinHeight(), maxContentHeight + border + GRAB_MARGIN));
+
+ setDefaultSize(getMinWidth(), getMaxHeight(), WindowAlignment::BottomRight);
place(0, 0, scrollArea, 5, 5).setPadding(0);