summaryrefslogtreecommitdiff
path: root/src/gui/shortcutwindow.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-23 21:59:21 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-23 22:00:09 +0100
commit99e8a3fd77b63a029fe02dcf771b6af1aad252ed (patch)
tree03c296d1f89859aae35336dfe2f58df09d256fd3 /src/gui/shortcutwindow.cpp
parentfa8a4bf49100c0a1d5b96e00803f43bbbb861100 (diff)
parent347452b9b69ef3af29c577b7751082822e900c01 (diff)
downloadmana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.tar.gz
mana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.tar.bz2
mana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.tar.xz
mana-99e8a3fd77b63a029fe02dcf771b6af1aad252ed.zip
Merge branch 'aethyra/master'
Conflicts: Many files.
Diffstat (limited to 'src/gui/shortcutwindow.cpp')
-rw-r--r--src/gui/shortcutwindow.cpp31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/gui/shortcutwindow.cpp b/src/gui/shortcutwindow.cpp
index c704fc44..dcc7f72e 100644
--- a/src/gui/shortcutwindow.cpp
+++ b/src/gui/shortcutwindow.cpp
@@ -23,6 +23,8 @@
#include "shortcutcontainer.h"
#include "shortcutwindow.h"
+#include "widgets/layout.h"
+
#include "../configuration.h"
static const int SCROLL_PADDING = 0;
@@ -39,29 +41,28 @@ ShortcutWindow::ShortcutWindow(const char *title, ShortcutContainer *content)
mItems = content;
- mInstances++;
-
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 width = (int) config.getValue("screenwidth", 800);
- const int height = (int) config.getValue("screenheight", 600);
+ setDefaultSize(mItems->getBoxWidth() + border, (mItems->getBoxHeight() *
+ mItems->getMaxItems()) + border, ImageRect::LOWER_RIGHT,
+ mInstances * mItems->getBoxWidth(), 0);
- setDefaultSize(width - (mInstances * mItems->getBoxWidth()) -
- (mInstances * border), height - (mItems->getBoxHeight() *
- mItems->getMaxItems()) - border, mItems->getBoxWidth() +
- border, (mItems->getBoxHeight() * mItems->getMaxItems()) +
- border);
+ mInstances++;
mScrollArea = new ScrollArea(mItems);
mScrollArea->setPosition(SCROLL_PADDING, SCROLL_PADDING);
mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
mScrollArea->setOpaque(false);
- add(mScrollArea);
+ place(0, 0, mScrollArea, 5, 5).setPadding(0);
+
+ Layout &layout = getLayout();
+ layout.setRowHeight(0, Layout::AUTO_SET);
+ layout.setMargin(0);
loadWindowState();
}
@@ -71,13 +72,3 @@ ShortcutWindow::~ShortcutWindow()
delete mItems;
}
-void ShortcutWindow::widgetResized(const gcn::Event &event)
-{
- Window::widgetResized(event);
-
- const gcn::Rectangle &area = getChildrenArea();
-
- mScrollArea->setSize(
- area.width - SCROLL_PADDING,
- area.height - SCROLL_PADDING);
-}