summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/popupmenu.cpp9
-rw-r--r--src/gui/popupmenu.h2
-rw-r--r--src/gui/viewport.cpp6
-rw-r--r--src/gui/viewport.h2
4 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index 5a75cb71d..c6838079c 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -2204,6 +2204,15 @@ void PopupMenu::showPopup(const int x, const int y, gcn::ListModel *model)
showPopup(x, y);
}
+void PopupMenu::clear()
+{
+ if (mDialog)
+ {
+ mDialog->close();
+ mDialog = nullptr;
+ }
+}
+
RenameListener::RenameListener() :
gcn::ActionListener(),
mMapItem(nullptr),
diff --git a/src/gui/popupmenu.h b/src/gui/popupmenu.h
index 431d7e7de..95cc3f65c 100644
--- a/src/gui/popupmenu.h
+++ b/src/gui/popupmenu.h
@@ -174,6 +174,8 @@ class PopupMenu final : public Popup, public LinkHandler
void handleLink(const std::string &link,
gcn::MouseEvent *event A_UNUSED) override;
+ void clear();
+
private:
void addPlayerRelation(std::string name);
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 5175d683d..fcd62caa5 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -1033,3 +1033,9 @@ void Viewport::validateSpeed() const
Game::instance()->setValidSpeed();
}
}
+
+void Viewport::clearPopup()
+{
+ if (mPopupMenu)
+ mPopupMenu->clear();
+}
diff --git a/src/gui/viewport.h b/src/gui/viewport.h
index 3724b4925..7cf02aecf 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -276,6 +276,8 @@ class Viewport final : public WindowContainer,
void returnCamera();
+ void clearPopup();
+
protected:
friend class ActorSpriteManager;