summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/itemshortcutcontainer.cpp21
-rw-r--r--src/gui/widgets/itemshortcutcontainer.h1
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;