diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-07 20:02:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-07 20:02:02 +0300 |
commit | 4fc40c384a3423e43f2e589809c9bc9aa8bda495 (patch) | |
tree | be68429d688d6ef7bcba72c865ebcd080db871c6 /src/gui/widgets | |
parent | 249d59d10905f46ee91683d08386c7bc9936bc4b (diff) | |
download | manaverse-4fc40c384a3423e43f2e589809c9bc9aa8bda495.tar.gz manaverse-4fc40c384a3423e43f2e589809c9bc9aa8bda495.tar.bz2 manaverse-4fc40c384a3423e43f2e589809c9bc9aa8bda495.tar.xz manaverse-4fc40c384a3423e43f2e589809c9bc9aa8bda495.zip |
For some popup menus use current mouse position.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/avatarlistbox.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/itemlinkhandler.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/textfield.cpp | 16 | ||||
-rw-r--r-- | src/gui/widgets/window.cpp | 17 |
4 files changed, 4 insertions, 39 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 909f01618..e0fbc4d4b 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -401,9 +401,7 @@ void AvatarListBox::mousePressed(MouseEvent &event) } else { - popupMenu->showPlayerPopup(viewport->mMouseX, - viewport->mMouseY, - avatar->getName()); + popupMenu->showPlayerPopup(avatar->getName()); } } break; diff --git a/src/gui/widgets/itemlinkhandler.cpp b/src/gui/widgets/itemlinkhandler.cpp index 6c04ca41f..eef888169 100644 --- a/src/gui/widgets/itemlinkhandler.cpp +++ b/src/gui/widgets/itemlinkhandler.cpp @@ -76,11 +76,7 @@ void ItemLinkHandler::handleLink(const std::string &link, MouseEvent *event) else if (button == MouseButton::RIGHT) { if (popupMenu) - { - popupMenu->showLinkPopup(viewport->mMouseX, - viewport->mMouseY, - url); - } + popupMenu->showLinkPopup(url); } } else if (!link.empty() && link[0] == '?') diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index a20b05e1e..48d3a86fc 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -706,21 +706,7 @@ void TextField::mousePressed(MouseEvent &event) if (event.getButton() == MouseButton::RIGHT) { if (popupMenu) - { - if (viewport) - { - popupMenu->showTextFieldPopup(viewport->mMouseX, - viewport->mMouseY, - this); - } - else - { - int mouseX = 0; - int mouseY = 0; - Gui::getMouseState(&mouseX, &mouseY); - popupMenu->showTextFieldPopup(mouseX, mouseY, this); - } - } + popupMenu->showTextFieldPopup(this); } else if (event.getButton() == MouseButton::LEFT) { diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index dd7627b23..5cf430821 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -769,22 +769,7 @@ void Window::mousePressed(MouseEvent &event) if (popupMenu) { event.consume(); - - if (viewport) - { - popupMenu->showWindowPopup(this, - viewport->mMouseX, - viewport->mMouseY); - } - else - { - int mouseX = 0; - int mouseY = 0; - Gui::getMouseState(&mouseX, &mouseY); - popupMenu->showWindowPopup(this, - mouseX, - mouseY); - } + popupMenu->showWindowPopup(this); } } } |