diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-17 15:24:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-17 15:24:27 +0300 |
commit | 13ffce92ad6ef7831a7d944a03bbe9520ac55453 (patch) | |
tree | 0ab69a209f34abdef9c1cbbf6548bd1be2bcf553 /src/gui/widgets | |
parent | 5daae228426e72d2015e644d79d95b2ab032d65f (diff) | |
download | manaverse-13ffce92ad6ef7831a7d944a03bbe9520ac55453.tar.gz manaverse-13ffce92ad6ef7831a7d944a03bbe9520ac55453.tar.bz2 manaverse-13ffce92ad6ef7831a7d944a03bbe9520ac55453.tar.xz manaverse-13ffce92ad6ef7831a7d944a03bbe9520ac55453.zip |
Use public item popup in itemshortcutcontainer.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/itemshortcutcontainer.cpp | 21 | ||||
-rw-r--r-- | src/gui/widgets/itemshortcutcontainer.h | 1 |
2 files changed, 9 insertions, 13 deletions
diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index 84b7bc249..ba677d90e 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -60,14 +60,12 @@ ItemShortcutContainer::ItemShortcutContainer(Widget2 *const widget, ShortcutContainer(widget), mItemClicked(false), mNumber(number), - mItemPopup(new ItemPopup), mSpellPopup(new SpellPopup), mEquipedColor(getThemeColor(Theme::ITEM_EQUIPPED)), mEquipedColor2(getThemeColor(Theme::ITEM_EQUIPPED_OUTLINE)), mUnEquipedColor(getThemeColor(Theme::ITEM_NOT_EQUIPPED)), mUnEquipedColor2(getThemeColor(Theme::ITEM_NOT_EQUIPPED_OUTLINE)) { - mItemPopup->postInit(); mSpellPopup->postInit(); if (itemShortcut[mNumber]) @@ -78,7 +76,6 @@ ItemShortcutContainer::ItemShortcutContainer(Widget2 *const widget, ItemShortcutContainer::~ItemShortcutContainer() { - delete2(mItemPopup); delete2(mSpellPopup); } @@ -415,17 +412,17 @@ void ItemShortcutContainer::mouseMoved(MouseEvent &event) const Item *const item = inv->findItem(itemId, itemColor); 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); } } else if (itemId < SKILL_MIN_ID && spellManager) { - mItemPopup->setVisible(false); + itemPopup->setVisible(false); const TextCommand *const spell = spellManager->getSpellByItem(itemId); if (spell && viewport) { @@ -439,23 +436,23 @@ void ItemShortcutContainer::mouseMoved(MouseEvent &event) } else if (skillDialog) { - mItemPopup->setVisible(false); + itemPopup->setVisible(false); } } // Hide ItemTooltip void ItemShortcutContainer::mouseExited(MouseEvent &event A_UNUSED) { - if (mItemPopup) - mItemPopup->setVisible(false); + if (itemPopup) + itemPopup->setVisible(false); if (mSpellPopup) mSpellPopup->setVisible(false); } void ItemShortcutContainer::widgetHidden(const Event &event A_UNUSED) { - if (mItemPopup) - mItemPopup->setVisible(false); + if (itemPopup) + itemPopup->setVisible(false); if (mSpellPopup) mSpellPopup->setVisible(false); } diff --git a/src/gui/widgets/itemshortcutcontainer.h b/src/gui/widgets/itemshortcutcontainer.h index 07c3ef822..6c268251a 100644 --- a/src/gui/widgets/itemshortcutcontainer.h +++ b/src/gui/widgets/itemshortcutcontainer.h @@ -81,7 +81,6 @@ class ItemShortcutContainer final : public ShortcutContainer bool mItemClicked; unsigned mNumber; - ItemPopup *mItemPopup; SpellPopup *mSpellPopup; Color mEquipedColor; Color mEquipedColor2; |