diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-17 15:21:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-17 15:21:32 +0300 |
commit | 5daae228426e72d2015e644d79d95b2ab032d65f (patch) | |
tree | 913607b980da20d177b67491493105ad100b4ee5 /src/gui/widgets | |
parent | 8abff8551a2c35c9e19c90eb4304db6195cf3575 (diff) | |
download | mv-5daae228426e72d2015e644d79d95b2ab032d65f.tar.gz mv-5daae228426e72d2015e644d79d95b2ab032d65f.tar.bz2 mv-5daae228426e72d2015e644d79d95b2ab032d65f.tar.xz mv-5daae228426e72d2015e644d79d95b2ab032d65f.zip |
Use public item popup in itemcontainer.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 15 | ||||
-rw-r--r-- | src/gui/widgets/itemcontainer.h | 1 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 3842daf17..27c640df5 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -172,7 +172,6 @@ ItemContainer::ItemContainer(const Widget2 *const widget, mSelImg(Theme::getImageFromThemeXml("item_selection.xml", "")), mProtectedImg(Theme::getImageFromTheme("lock.png")), mName(), - mItemPopup(new ItemPopup), mShowMatrix(nullptr), mSkin(theme ? theme->load("itemcontainer.xml", "") : nullptr), mEquipedColor(getThemeColor(Theme::ITEM_EQUIPPED)), @@ -197,7 +196,6 @@ ItemContainer::ItemContainer(const Widget2 *const widget, mForceQuantity(forceQuantity), mDescItems(false) { - mItemPopup->postInit(); setFocusable(true); addKeyListener(this); addMouseListener(this); @@ -224,7 +222,6 @@ ItemContainer::~ItemContainer() if (theme) theme->unload(mSkin); - delete2(mItemPopup); delete []mShowMatrix; } @@ -386,8 +383,8 @@ void ItemContainer::distributeValueChangedEvent() void ItemContainer::hidePopup() { - if (mItemPopup) - mItemPopup->setVisible(false); + if (itemPopup) + itemPopup->setVisible(false); } void ItemContainer::keyPressed(KeyEvent &event A_UNUSED) @@ -609,18 +606,18 @@ void ItemContainer::mouseMoved(MouseEvent &event) if (item && viewport) { - mItemPopup->setItem(item); - mItemPopup->position(viewport->getMouseX(), viewport->getMouseY()); + itemPopup->setItem(item); + itemPopup->position(viewport->getMouseX(), viewport->getMouseY()); } else { - mItemPopup->setVisible(false); + itemPopup->setVisible(false); } } void ItemContainer::mouseExited(MouseEvent &event A_UNUSED) { - mItemPopup->setVisible(false); + itemPopup->setVisible(false); } void ItemContainer::widgetResized(const Event &event A_UNUSED) diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h index 0fbe84da9..3f56f8855 100644 --- a/src/gui/widgets/itemcontainer.h +++ b/src/gui/widgets/itemcontainer.h @@ -181,7 +181,6 @@ class ItemContainer final : public Widget, Image *mProtectedImg; std::string mName; - ItemPopup *mItemPopup; int *mShowMatrix; Skin *mSkin; Color mEquipedColor; |