summaryrefslogtreecommitdiff
path: root/scene/gui/popup_menu.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-10-17 12:48:47 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-10-17 12:48:47 -0300
commit6f9631fc5151b3267c6fcea5f70249fc36814db8 (patch)
tree2aa06230d95846602aa731967264c1619baa2a39 /scene/gui/popup_menu.cpp
parent63033aa646f7a49fbcecbc8cc30077cf268be10c (diff)
parentbe0f7563fbff581ca072504978bedc6a55e180f1 (diff)
Merge branch 'master' of https://github.com/okamstudio/godot
Diffstat (limited to 'scene/gui/popup_menu.cpp')
-rw-r--r--scene/gui/popup_menu.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index 5afe2ed704..6c21ea639f 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -740,10 +740,18 @@ int PopupMenu::find_item_by_accelerator(uint32_t p_accel) const {
void PopupMenu::activate_item(int p_item) {
-
ERR_FAIL_INDEX(p_item,items.size());
ERR_FAIL_COND(items[p_item].separator);
emit_signal("item_pressed",items[p_item].ID);
+
+ //hide all parent PopupMenue's
+ Node *next = get_parent();
+ PopupMenu *pop = next->cast_to<PopupMenu>();
+ while (pop) {
+ pop->hide();
+ next = next->get_parent();
+ pop = next->cast_to<PopupMenu>();
+ }
hide();
}