summaryrefslogtreecommitdiff
path: root/src/gui/shortcutwindow.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-03-10 11:50:27 -0600
committerIra Rice <irarice@gmail.com>2009-03-10 11:50:27 -0600
commit58ee835c3763e7bf088fa6c7e31dda1d687589cc (patch)
tree2eb06f7ee3fa05af68fb536284497a9967222ad9 /src/gui/shortcutwindow.cpp
parent5bbf8219bffbb587cf9a23561734c917bb23f42f (diff)
downloadmana-client-58ee835c3763e7bf088fa6c7e31dda1d687589cc.tar.gz
mana-client-58ee835c3763e7bf088fa6c7e31dda1d687589cc.tar.bz2
mana-client-58ee835c3763e7bf088fa6c7e31dda1d687589cc.tar.xz
mana-client-58ee835c3763e7bf088fa6c7e31dda1d687589cc.zip
Extended window layout to take relative positions, as well as offsets to
that position. This makes it so that when resolutions are changed, the default locations stay relative to the window's position, and not the 800x600 screen resolution. Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/shortcutwindow.cpp')
-rw-r--r--src/gui/shortcutwindow.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/gui/shortcutwindow.cpp b/src/gui/shortcutwindow.cpp
index ee32ca70..c2df1f9c 100644
--- a/src/gui/shortcutwindow.cpp
+++ b/src/gui/shortcutwindow.cpp
@@ -40,22 +40,17 @@ 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);