diff options
Diffstat (limited to 'src/gui/widgets/spellshortcutcontainer.cpp')
-rw-r--r-- | src/gui/widgets/spellshortcutcontainer.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index 164513d73..1ddf17981 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -46,12 +46,9 @@ SpellShortcutContainer::SpellShortcutContainer(Widget2 *const widget, const unsigned number) : ShortcutContainer(widget), - mSpellPopup(new SpellPopup), mNumber(number), mSpellClicked(false) { - mSpellPopup->postInit(); - if (spellShortcut) mMaxItems = spellShortcut->getSpellsCount(); else @@ -60,7 +57,6 @@ SpellShortcutContainer::SpellShortcutContainer(Widget2 *const widget, SpellShortcutContainer::~SpellShortcutContainer() { - delete2(mSpellPopup); } void SpellShortcutContainer::setWidget2(const Widget2 *const widget) @@ -273,7 +269,7 @@ void SpellShortcutContainer::mouseReleased(MouseEvent &event) // Show ItemTooltip void SpellShortcutContainer::mouseMoved(MouseEvent &event) { - if (!mSpellPopup || !spellShortcut || !spellManager) + if (!spellPopup || !spellShortcut || !spellManager) return; const int index = getIndexFromGrid(event.getX(), event.getY()); @@ -282,29 +278,29 @@ void SpellShortcutContainer::mouseMoved(MouseEvent &event) return; const int itemId = getItemByIndex(index); - mSpellPopup->setVisible(false); + spellPopup->setVisible(false); const TextCommand *const spell = spellManager->getSpell(itemId); if (spell && !spell->isEmpty()) { - mSpellPopup->setItem(spell); - mSpellPopup->view(viewport->getMouseX(), viewport->getMouseY()); + spellPopup->setItem(spell); + spellPopup->view(viewport->getMouseX(), viewport->getMouseY()); } else { - mSpellPopup->setVisible(false); + spellPopup->setVisible(false); } } void SpellShortcutContainer::mouseExited(MouseEvent &event A_UNUSED) { - if (mSpellPopup) - mSpellPopup->setVisible(false); + if (spellPopup) + spellPopup->setVisible(false); } void SpellShortcutContainer::widgetHidden(const Event &event A_UNUSED) { - if (mSpellPopup) - mSpellPopup->setVisible(false); + if (spellPopup) + spellPopup->setVisible(false); } int SpellShortcutContainer::getItemByIndex(const int index) const |