summaryrefslogtreecommitdiff
path: root/src/gui/shortcutwindow.cpp
diff options
context:
space:
mode:
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);