summaryrefslogtreecommitdiff
path: root/src/gui/popups
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-10 21:34:14 +0300
committerAndrei Karas <akaras@inbox.ru>2015-11-10 21:34:14 +0300
commitcb6f070779f94f3d69ba7576affb0588b61e7b7c (patch)
tree2ae6218ffff3691ca883de66007a4cd3b833bf5c /src/gui/popups
parentb7d3acab99fe4975d4598b6c9ac1ad88edfa8506 (diff)
downloadplus-cb6f070779f94f3d69ba7576affb0588b61e7b7c.tar.gz
plus-cb6f070779f94f3d69ba7576affb0588b61e7b7c.tar.bz2
plus-cb6f070779f94f3d69ba7576affb0588b61e7b7c.tar.xz
plus-cb6f070779f94f3d69ba7576affb0588b61e7b7c.zip
Add close to minimap context menu.
Diffstat (limited to 'src/gui/popups')
-rw-r--r--src/gui/popups/popupmenu.cpp15
-rw-r--r--src/gui/popups/popupmenu.h3
2 files changed, 15 insertions, 3 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 71a6d81d5..d9d3999c1 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -41,10 +41,12 @@
#include "gui/buttontext.h"
#include "gui/gui.h"
#include "gui/viewport.h"
+#include "gui/windowmenu.h"
#include "gui/windows/chatwindow.h"
#include "gui/windows/equipmentwindow.h"
#include "gui/windows/inventorywindow.h"
+#include "gui/windows/minimap.h"
#include "gui/windows/ministatuswindow.h"
#include "gui/windows/npcdialog.h"
#include "gui/windows/outfitwindow.h"
@@ -52,7 +54,6 @@
#include "gui/windows/textcommandeditor.h"
#include "gui/windows/textdialog.h"
#include "gui/windows/tradewindow.h"
-#include "gui/windowmenu.h"
#include "gui/widgets/button.h"
#include "gui/widgets/createwidget.h"
@@ -638,11 +639,15 @@ void PopupMenu::showPopup(const int x, const int y, MapItem *const mapItem)
}
void PopupMenu::showMapPopup(const int x, const int y,
- const int x2, const int y2)
+ const int x2, const int y2,
+ const bool isMinimap)
{
mX = x2;
mY = y2;
+ if (isMinimap)
+ mWindow = minimap;
+
mBrowserBox->clearRows();
// TRANSLATORS: popup menu header
@@ -661,6 +666,12 @@ void PopupMenu::showMapPopup(const int x, const int y,
// TRANSLATORS: move camera to map item
mBrowserBox->addRow("/movecamera 'X' 'Y'", _("Move camera"));
mBrowserBox->addRow("##3---");
+ if (isMinimap)
+ {
+ // TRANSLATORS: popup menu item
+ mBrowserBox->addRow("window close", _("Close"));
+ }
+ mBrowserBox->addRow("##3---");
// TRANSLATORS: popup menu item
// TRANSLATORS: close menu
mBrowserBox->addRow("cancel", _("Cancel"));
diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h
index 3952178f2..e8e0ddeb4 100644
--- a/src/gui/popups/popupmenu.h
+++ b/src/gui/popups/popupmenu.h
@@ -128,7 +128,8 @@ class PopupMenu final : public Popup, public LinkHandler
Item *const item);
void showMapPopup(const int x, const int y,
- const int x2, const int y2);
+ const int x2, const int y2,
+ const bool isMinimap);
/**
* Shows the related popup menu when right click on the chat