summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-17 14:21:38 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-17 14:21:38 +0300
commit19c60fcd436778c020145e58817ed443a53478d9 (patch)
treeb957eb5135b78dfb1ad70d723e27a9443d63f01f /src/gui
parentce6110221f43e5b8cd24ba954de17d00ac84fc9d (diff)
downloadplus-19c60fcd436778c020145e58817ed443a53478d9.tar.gz
plus-19c60fcd436778c020145e58817ed443a53478d9.tar.bz2
plus-19c60fcd436778c020145e58817ed443a53478d9.tar.xz
plus-19c60fcd436778c020145e58817ed443a53478d9.zip
Use public text popup in windowmenu.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/windowmenu.cpp17
-rw-r--r--src/gui/windowmenu.h2
2 files changed, 7 insertions, 12 deletions
diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp
index f998fe7b9..dfbfc5d3d 100644
--- a/src/gui/windowmenu.cpp
+++ b/src/gui/windowmenu.cpp
@@ -56,7 +56,6 @@ WindowMenu::WindowMenu(const Widget2 *const widget) :
mSkin(theme ? theme->load("windowmenu.xml", "") : nullptr),
mPadding(mSkin ? mSkin->getPadding() : 1),
mSpacing(mSkin ? mSkin->getOption("spacing", 3) : 3),
- mTextPopup(new TextPopup),
mButtons(),
mButtonTexts(),
mButtonNames(),
@@ -64,7 +63,6 @@ WindowMenu::WindowMenu(const Widget2 *const widget) :
mAutoHide(1),
mSmallWindow(mainGraphics->getWidth() < 600)
{
- mTextPopup->postInit();
int x = mPadding;
int h = 0;
@@ -182,7 +180,6 @@ WindowMenu::~WindowMenu()
config.removeListener("autohideButtons", this);
CHECKLISTENERS
- delete2(mTextPopup);
for (std::map <std::string, ButtonInfo*>::iterator
it = mButtonNames.begin(),
it_end = mButtonNames.end(); it != it_end; ++it)
@@ -270,12 +267,12 @@ void WindowMenu::mouseMoved(MouseEvent &event)
{
mHaveMouse = true;
- if (!mTextPopup)
+ if (!textPopup)
return;
if (event.getSource() == this)
{
- mTextPopup->hide();
+ textPopup->hide();
return;
}
@@ -284,7 +281,7 @@ void WindowMenu::mouseMoved(MouseEvent &event)
if (!btn)
{
- mTextPopup->hide();
+ textPopup->hide();
return;
}
@@ -294,24 +291,24 @@ void WindowMenu::mouseMoved(MouseEvent &event)
const Rect &rect = mDimension;
if (key != InputAction::NO_VALUE)
{
- mTextPopup->show(x + rect.x, y + rect.y, btn->getDescription(),
+ textPopup->show(x + rect.x, y + rect.y, btn->getDescription(),
// TRANSLATORS: short key name
strprintf(_("Key: %s"), inputManager.getKeyValueString(
key).c_str()));
}
else
{
- mTextPopup->show(x + rect.x, y + rect.y, btn->getDescription());
+ textPopup->show(x + rect.x, y + rect.y, btn->getDescription());
}
}
void WindowMenu::mouseExited(MouseEvent& event A_UNUSED)
{
mHaveMouse = false;
- if (!mTextPopup)
+ if (!textPopup)
return;
- mTextPopup->hide();
+ textPopup->hide();
}
void WindowMenu::showButton(const std::string &name, const bool visible)
diff --git a/src/gui/windowmenu.h b/src/gui/windowmenu.h
index a32272ef9..075de1e6b 100644
--- a/src/gui/windowmenu.h
+++ b/src/gui/windowmenu.h
@@ -37,7 +37,6 @@
#include <vector>
class Button;
-class TextPopup;
struct ButtonInfo;
struct ButtonText;
@@ -104,7 +103,6 @@ class WindowMenu final : public Container,
Skin *mSkin;
int mPadding;
int mSpacing;
- TextPopup *mTextPopup;
std::vector <Button*> mButtons;
std::vector <ButtonText*> mButtonTexts;
std::map <std::string, ButtonInfo*> mButtonNames;