summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-17 16:11:42 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-17 16:11:42 +0300
commit4129e2ef64e5c81f93009d98e50436c1b4d93016 (patch)
treed48a291e104b88631b2f15b9c783d91fda98737e /src/gui/widgets
parent8daae3e4f095a58e3cb39f203cf69e405cda70c1 (diff)
downloadmv-4129e2ef64e5c81f93009d98e50436c1b4d93016.tar.gz
mv-4129e2ef64e5c81f93009d98e50436c1b4d93016.tar.bz2
mv-4129e2ef64e5c81f93009d98e50436c1b4d93016.tar.xz
mv-4129e2ef64e5c81f93009d98e50436c1b4d93016.zip
Use public spell popup in spellshortcutcontainer.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/spellshortcutcontainer.cpp22
-rw-r--r--src/gui/widgets/spellshortcutcontainer.h1
2 files changed, 9 insertions, 14 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
diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h
index ba192d4bc..939e315af 100644
--- a/src/gui/widgets/spellshortcutcontainer.h
+++ b/src/gui/widgets/spellshortcutcontainer.h
@@ -79,7 +79,6 @@ class SpellShortcutContainer final : public ShortcutContainer
int getItemByIndex(const int index) const A_WARN_UNUSED;
private:
- SpellPopup *mSpellPopup;
unsigned int mNumber;
bool mSpellClicked;
};