diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-17 14:21:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-17 14:21:38 +0300 |
commit | 19c60fcd436778c020145e58817ed443a53478d9 (patch) | |
tree | b957eb5135b78dfb1ad70d723e27a9443d63f01f /src/gui/windowmenu.cpp | |
parent | ce6110221f43e5b8cd24ba954de17d00ac84fc9d (diff) | |
download | manaverse-19c60fcd436778c020145e58817ed443a53478d9.tar.gz manaverse-19c60fcd436778c020145e58817ed443a53478d9.tar.bz2 manaverse-19c60fcd436778c020145e58817ed443a53478d9.tar.xz manaverse-19c60fcd436778c020145e58817ed443a53478d9.zip |
Use public text popup in windowmenu.
Diffstat (limited to 'src/gui/windowmenu.cpp')
-rw-r--r-- | src/gui/windowmenu.cpp | 17 |
1 files changed, 7 insertions, 10 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) |