From c42eba00701f28b3cf720d90c73d1cfc6c3815da Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Sat, 7 Feb 2009 15:09:11 -0700 Subject: Adjusted the shortcut window initialization so that all new shortcut window instances don't overlap by default. After that, it'll defer to the user's saved window positions. Signed-off-by: Ira Rice --- src/gui/shortcutwindow.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/gui/shortcutwindow.cpp') diff --git a/src/gui/shortcutwindow.cpp b/src/gui/shortcutwindow.cpp index 91b33b72..dd8634f7 100644 --- a/src/gui/shortcutwindow.cpp +++ b/src/gui/shortcutwindow.cpp @@ -27,6 +27,8 @@ static const int SCROLL_PADDING = 0; +int ShortcutWindow::mInstances = 1; + ShortcutWindow::ShortcutWindow(const char *title, ShortcutContainer *content) { setWindowName(title); @@ -46,16 +48,19 @@ ShortcutWindow::ShortcutWindow(const char *title, ShortcutContainer *content) const int width = (int) config.getValue("screenwidth", 800); const int height = (int) config.getValue("screenheight", 600); - setDefaultSize(width - mItems->getBoxWidth() - border, - height - (mItems->getBoxHeight() * mItems->getMaxItems()) - - border, mItems->getBoxWidth() + border, - (mItems->getBoxHeight() * mItems->getMaxItems()) + border); + setDefaultSize(width - (mInstances * mItems->getBoxWidth()) - + (mInstances * border), height - (mItems->getBoxHeight() * + mItems->getMaxItems()) - border, mItems->getBoxWidth() + + border, (mItems->getBoxHeight() * mItems->getMaxItems()) + + border); mScrollArea = new ScrollArea(mItems); mScrollArea->setPosition(SCROLL_PADDING, SCROLL_PADDING); mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); mScrollArea->setOpaque(false); + mInstances++; + add(mScrollArea); loadWindowState(); -- cgit v1.2.3-60-g2f50