summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2015-12-29 09:26:17 -0300
committerreduz <reduzio@gmail.com>2015-12-29 09:26:17 -0300
commit45ad1024e12ffa6db0e56cb36c007dd212d5e37e (patch)
treeb44560731410bf963a4b105ec07ae2aa698348cc /scene/gui
parent0c6a4b47a67774c1a29251058d40e9733a13102e (diff)
make it easy to edit popupmenus, fixes #2595
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/popup.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp
index 5ce7e2e0d3..43703c589c 100644
--- a/scene/gui/popup.cpp
+++ b/scene/gui/popup.cpp
@@ -45,6 +45,14 @@ void Popup::_notification(int p_what) {
emit_signal("popup_hide");
}
}
+
+ if (p_what==NOTIFICATION_ENTER_TREE) {
+ //small helper to make editing of these easier in editor
+ if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) {
+ set_as_toplevel(false);
+ }
+ }
+
}
void Popup::_fix_size() {