diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-07-31 23:20:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-07-31 23:20:54 +0300 |
commit | 33ef923235aeabd07308816bb07ef790cc6c1024 (patch) | |
tree | e50c8bbefae98bc57e5b804ba145bca2005c5ca7 /src/gui/widgets/textfield.cpp | |
parent | b6bd4b5d68df33d12f18a67de2e54e016a0935fe (diff) | |
download | ManaVerse-33ef923235aeabd07308816bb07ef790cc6c1024.tar.gz ManaVerse-33ef923235aeabd07308816bb07ef790cc6c1024.tar.bz2 ManaVerse-33ef923235aeabd07308816bb07ef790cc6c1024.tar.xz ManaVerse-33ef923235aeabd07308816bb07ef790cc6c1024.zip |
Move popup related code from viewport into popupManager.
Diffstat (limited to 'src/gui/widgets/textfield.cpp')
-rw-r--r-- | src/gui/widgets/textfield.cpp | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index fb1bcc1db..cdfbac68a 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -70,8 +70,8 @@ #include "input/inputmanager.h" #include "gui/gui.h" +#include "gui/popupmanager.h" #include "gui/skin.h" -#include "gui/viewport.h" #ifdef ANDROID #include "gui/windowmanager.h" #endif @@ -709,25 +709,8 @@ void TextField::mousePressed(MouseEvent &event) event.consume(); if (event.getButton() == MouseButton::RIGHT) { - if (viewport) - { - viewport->showTextFieldPopup(this); - } - else - { - if (!mPopupMenu) - { - mPopupMenu = new PopupMenu(); - mPopupMenu->postInit(); - } - if (gui) - { - int x = 0; - int y = 0; - Gui::getMouseState(&x, &y); - mPopupMenu->showTextFieldPopup(x, y, this); - } - } + if (popupManager) + popupManager->showTextFieldPopup(this); } else if (event.getButton() == MouseButton::LEFT) { |