diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-10-18 15:42:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-10-19 15:12:20 +0300 |
commit | 9bffd0bf7ccdb24ab6f6f0e9dbc96b6b554bacff (patch) | |
tree | 05f4b7dd27d335d3d547f40dfbeded25bda1011e | |
parent | 7559ba2bf6cec8cfabae572436d80f55dacc9371 (diff) | |
download | manaplus-9bffd0bf7ccdb24ab6f6f0e9dbc96b6b554bacff.tar.gz manaplus-9bffd0bf7ccdb24ab6f6f0e9dbc96b6b554bacff.tar.bz2 manaplus-9bffd0bf7ccdb24ab6f6f0e9dbc96b6b554bacff.tar.xz manaplus-9bffd0bf7ccdb24ab6f6f0e9dbc96b6b554bacff.zip |
move virtual member calls from itempopup constuctor into postInit.
-rw-r--r-- | src/gui/popups/itempopup.cpp | 3 | ||||
-rw-r--r-- | src/gui/popups/itempopup.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/dropshortcutcontainer.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 1 | ||||
-rw-r--r-- | src/gui/widgets/itemlinkhandler.cpp | 1 | ||||
-rw-r--r-- | src/gui/widgets/itemshortcutcontainer.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/shoplistbox.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/equipmentwindow.cpp | 1 | ||||
-rw-r--r-- | src/gui/windows/itemamountwindow.cpp | 2 |
9 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/popups/itempopup.cpp b/src/gui/popups/itempopup.cpp index c05073750..72fd3e0bd 100644 --- a/src/gui/popups/itempopup.cpp +++ b/src/gui/popups/itempopup.cpp @@ -77,7 +77,10 @@ ItemPopup::ItemPopup() : mItemWeight->setPosition(0, 3 * fontHeight); mItemWeight->setForegroundColorAll(getThemeColor(Theme::POPUP), getThemeColor(Theme::POPUP_OUTLINE)); +} +void ItemPopup::postInit() +{ add(mItemName); add(mItemDesc); add(mItemEffect); diff --git a/src/gui/popups/itempopup.h b/src/gui/popups/itempopup.h index 5c06cbf5a..4902a97b0 100644 --- a/src/gui/popups/itempopup.h +++ b/src/gui/popups/itempopup.h @@ -50,6 +50,8 @@ class ItemPopup final : public Popup */ ~ItemPopup(); + void postInit() override; + /** * Sets the info to be displayed given a particular item. */ diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp index 92daf8b77..d8f2f1d68 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -49,6 +49,8 @@ DropShortcutContainer::DropShortcutContainer(): mUnEquipedColor(getThemeColor(Theme::ITEM_NOT_EQUIPPED)), mUnEquipedColor2(getThemeColor(Theme::ITEM_NOT_EQUIPPED_OUTLINE)) { + mItemPopup->postInit(); + addMouseListener(this); addWidgetListener(this); diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 217e30735..8754210f8 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -195,6 +195,7 @@ ItemContainer::ItemContainer(const Widget2 *const widget, mSwapItems(false), mDescItems(false) { + mItemPopup->postInit(); setFocusable(true); addKeyListener(this); addMouseListener(this); diff --git a/src/gui/widgets/itemlinkhandler.cpp b/src/gui/widgets/itemlinkhandler.cpp index 18eccecb1..bca0585a1 100644 --- a/src/gui/widgets/itemlinkhandler.cpp +++ b/src/gui/widgets/itemlinkhandler.cpp @@ -66,6 +66,7 @@ namespace ItemLinkHandler::ItemLinkHandler() : mItemPopup(new ItemPopup) { + mItemPopup->postInit(); } ItemLinkHandler::~ItemLinkHandler() diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index 87ce28fe0..d85a1e73e 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -60,6 +60,8 @@ ItemShortcutContainer::ItemShortcutContainer(const unsigned number) : mUnEquipedColor(getThemeColor(Theme::ITEM_NOT_EQUIPPED)), mUnEquipedColor2(getThemeColor(Theme::ITEM_NOT_EQUIPPED_OUTLINE)) { + mItemPopup->postInit(); + addMouseListener(this); addWidgetListener(this); diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index d0ff4e746..cc622653d 100644 --- a/src/gui/widgets/shoplistbox.cpp +++ b/src/gui/widgets/shoplistbox.cpp @@ -56,6 +56,7 @@ ShopListBox::ShopListBox(const Widget2 *const widget, mPriceCheck(true), mProtectItems(false) { + mItemPopup->postInit(); mHighlightColor = getThemeColor(Theme::HIGHLIGHT); mForegroundColor = getThemeColor(Theme::LISTBOX); } @@ -73,6 +74,7 @@ ShopListBox::ShopListBox(const Widget2 *const widget, mPriceCheck(true), mProtectItems(false) { + mItemPopup->postInit(); mHighlightColor = getThemeColor(Theme::HIGHLIGHT); mForegroundColor = getThemeColor(Theme::LISTBOX); } diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 9b4082f7f..688fb814a 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -86,6 +86,7 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment, mMaxX(0), mMaxY(0) { + mItemPopup->postInit(); if (setupWindow) setupWindow->registerWindowForReset(this); diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp index 0c0f0bfe2..6fd813183 100644 --- a/src/gui/windows/itemamountwindow.cpp +++ b/src/gui/windows/itemamountwindow.cpp @@ -155,6 +155,8 @@ ItemAmountWindow::ItemAmountWindow(const Usage usage, Window *const parent, mPrice(0), mEnabledKeyboard(keyboard.isEnabled()) { + mItemPopup->postInit(); + if (!mItem) return; |