summaryrefslogtreecommitdiff
path: root/src/gui/widgets/emoteshortcutcontainer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-17 14:24:14 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-17 14:24:14 +0300
commit26c97eda5cb85b253706d49afff55580ace9e5bf (patch)
treeac7309e98580d9afacda539f3fff5c432cf308e0 /src/gui/widgets/emoteshortcutcontainer.cpp
parent19c60fcd436778c020145e58817ed443a53478d9 (diff)
downloadmanaverse-26c97eda5cb85b253706d49afff55580ace9e5bf.tar.gz
manaverse-26c97eda5cb85b253706d49afff55580ace9e5bf.tar.bz2
manaverse-26c97eda5cb85b253706d49afff55580ace9e5bf.tar.xz
manaverse-26c97eda5cb85b253706d49afff55580ace9e5bf.zip
Use public text popup in emoteshortcutcontainer.
Diffstat (limited to 'src/gui/widgets/emoteshortcutcontainer.cpp')
-rw-r--r--src/gui/widgets/emoteshortcutcontainer.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp
index 1e438f119..a1fee31a2 100644
--- a/src/gui/widgets/emoteshortcutcontainer.cpp
+++ b/src/gui/widgets/emoteshortcutcontainer.cpp
@@ -48,12 +48,9 @@ static const int MAX_ITEMS = 48;
EmoteShortcutContainer::EmoteShortcutContainer(Widget2 *const widget) :
ShortcutContainer(widget),
mEmoteImg(),
- mEmotePopup(new TextPopup),
mEmoteClicked(false),
mEmoteMoved(0)
{
- mEmotePopup->postInit();
-
if (mBackgroundImg)
mBackgroundImg->setAlpha(settings.guiAlpha);
@@ -70,7 +67,6 @@ EmoteShortcutContainer::EmoteShortcutContainer(Widget2 *const widget) :
EmoteShortcutContainer::~EmoteShortcutContainer()
{
- delete2(mEmotePopup);
}
void EmoteShortcutContainer::setWidget2(const Widget2 *const widget)
@@ -190,7 +186,7 @@ void EmoteShortcutContainer::mouseReleased(MouseEvent &event)
void EmoteShortcutContainer::mouseMoved(MouseEvent &event)
{
- if (!emoteShortcut || !mEmotePopup)
+ if (!emoteShortcut || !textPopup)
return;
const int index = getIndexFromGrid(event.getX(), event.getY());
@@ -198,24 +194,24 @@ void EmoteShortcutContainer::mouseMoved(MouseEvent &event)
if (index == -1)
return;
- mEmotePopup->setVisible(false);
+ textPopup->setVisible(false);
if (static_cast<size_t>(index) < mEmoteImg.size() && mEmoteImg[index])
{
const EmoteSprite *const sprite = mEmoteImg[index];
- mEmotePopup->show(viewport->getMouseX(), viewport->getMouseY(),
+ textPopup->show(viewport->getMouseX(), viewport->getMouseY(),
strprintf("%s, %d", sprite->name.c_str(), sprite->id));
}
}
void EmoteShortcutContainer::mouseExited(MouseEvent &event A_UNUSED)
{
- if (mEmotePopup)
- mEmotePopup->setVisible(false);
+ if (textPopup)
+ textPopup->setVisible(false);
}
void EmoteShortcutContainer::widgetHidden(const Event &event A_UNUSED)
{
- if (mEmotePopup)
- mEmotePopup->setVisible(false);
+ if (textPopup)
+ textPopup->setVisible(false);
}