From b7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 7 Sep 2012 22:09:11 +0300 Subject: Improve constructors in some classes. --- src/gui/shortcutwindow.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/gui/shortcutwindow.cpp') 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) -- cgit v1.2.3-60-g2f50