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.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/gui/shortcutwindow.cpp b/src/gui/shortcutwindow.cpp
index 3a142cbc2..52ac58757 100644
--- a/src/gui/shortcutwindow.cpp
+++ b/src/gui/shortcutwindow.cpp
@@ -41,10 +41,11 @@ int ShortcutWindow::mBoxesWidth = 0;
class ShortcutTab : public Tab
{
public:
- ShortcutTab(std::string name, ShortcutContainer *const content)
+ ShortcutTab(std::string name, ShortcutContainer *const content) :
+ Tab(),
+ mContent(content)
{
setCaption(name);
- mContent = content;
}
ShortcutContainer* mContent;
@@ -54,7 +55,10 @@ ShortcutWindow::ShortcutWindow(const std::string &title,
ShortcutContainer *const content,
std::string skinFile,
int width, int height) :
- Window("Window", false, nullptr, skinFile)
+ Window("Window", false, nullptr, skinFile),
+ mItems(content),
+ mScrollArea(new ScrollArea(mItems, false)),
+ mTabs(nullptr)
{
setWindowName(title);
setTitleBarHeight(getPadding() + getTitlePadding());
@@ -69,9 +73,6 @@ ShortcutWindow::ShortcutWindow(const std::string &title,
setupWindow->registerWindowForReset(this);
- mTabs = nullptr;
- mItems = content;
-
const int border = SCROLL_PADDING * 2 + getPadding() * 2;
setMinWidth(mItems->getBoxWidth() + border);
setMinHeight(mItems->getBoxHeight() + border);
@@ -87,7 +88,6 @@ ShortcutWindow::ShortcutWindow(const std::string &title,
mBoxesWidth += mItems->getBoxWidth() + border;
- mScrollArea = new ScrollArea(mItems, false);
mScrollArea->setPosition(SCROLL_PADDING, SCROLL_PADDING);
mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
@@ -102,7 +102,10 @@ ShortcutWindow::ShortcutWindow(const std::string &title,
ShortcutWindow::ShortcutWindow(const std::string &title, std::string skinFile,
const int width, const int height) :
- Window("Window", false, nullptr, skinFile)
+ Window("Window", false, nullptr, skinFile),
+ mItems(nullptr),
+ mScrollArea(nullptr),
+ mTabs(new TabbedArea)
{
setWindowName(title);
setTitleBarHeight(getPadding() + getTitlePadding());
@@ -116,10 +119,6 @@ ShortcutWindow::ShortcutWindow(const std::string &title, std::string skinFile,
setupWindow->registerWindowForReset(this);
- mTabs = new TabbedArea;
-
- mItems = nullptr;
-
const int border = SCROLL_PADDING * 2 + getPadding() * 2;
if (width && height)