diff options
author | Ira Rice <irarice@gmail.com> | 2009-02-07 15:09:11 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-02-07 15:09:11 -0700 |
commit | c42eba00701f28b3cf720d90c73d1cfc6c3815da (patch) | |
tree | c9ea05bb8a65c34147f5f62e00db2a4987710bf4 /src/gui | |
parent | e973dd25b1181ddb554a56888c3c361f131b4b3a (diff) | |
download | mana-client-c42eba00701f28b3cf720d90c73d1cfc6c3815da.tar.gz mana-client-c42eba00701f28b3cf720d90c73d1cfc6c3815da.tar.bz2 mana-client-c42eba00701f28b3cf720d90c73d1cfc6c3815da.tar.xz mana-client-c42eba00701f28b3cf720d90c73d1cfc6c3815da.zip |
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 <irarice@gmail.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/shortcutwindow.cpp | 13 | ||||
-rw-r--r-- | src/gui/shortcutwindow.h | 2 |
2 files changed, 11 insertions, 4 deletions
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(); diff --git a/src/gui/shortcutwindow.h b/src/gui/shortcutwindow.h index 2711ced5..64592328 100644 --- a/src/gui/shortcutwindow.h +++ b/src/gui/shortcutwindow.h @@ -55,6 +55,8 @@ class ShortcutWindow : public Window ShortcutContainer *mItems; ScrollArea *mScrollArea; + + static int mInstances; }; extern ShortcutWindow *itemShortcutWindow; |