summaryrefslogtreecommitdiff
path: root/src/gui/shortcutwindow.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-02-09 23:47:02 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-02-09 23:47:02 +0100
commitfa2f3ac593a792c32095c2e885665ec91bb4019d (patch)
treef44aee845f0229dfcc6b2ad3c74613e0352f36c2 /src/gui/shortcutwindow.cpp
parent07f7d52f661a74e6d0c780ca53e724651e3dcc48 (diff)
parent40edf4e91558cffd83d9015a2cf4a16360e27855 (diff)
downloadmana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.tar.gz
mana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.tar.bz2
mana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.tar.xz
mana-client-fa2f3ac593a792c32095c2e885665ec91bb4019d.zip
Merged with Aethyra master as of 2009-02-09
Conflicts: A lot of files...
Diffstat (limited to 'src/gui/shortcutwindow.cpp')
-rw-r--r--src/gui/shortcutwindow.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gui/shortcutwindow.cpp b/src/gui/shortcutwindow.cpp
index 799fc35b..5d49a3c6 100644
--- a/src/gui/shortcutwindow.cpp
+++ b/src/gui/shortcutwindow.cpp
@@ -19,14 +19,16 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include "scrollarea.h"
#include "shortcutcontainer.h"
#include "shortcutwindow.h"
-#include "scrollarea.h"
#include "../configuration.h"
static const int SCROLL_PADDING = 0;
+int ShortcutWindow::mInstances = 0;
+
ShortcutWindow::ShortcutWindow(const char *title, ShortcutContainer *content)
{
setWindowName(title);
@@ -37,6 +39,8 @@ 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);
@@ -46,10 +50,11 @@ 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);