summaryrefslogtreecommitdiff
path: root/scene/gui/dialogs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/dialogs.cpp')
-rw-r--r--scene/gui/dialogs.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index d081eda86d..35d54d9843 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -31,6 +31,10 @@
#include "print_string.h"
#include "translation.h"
+#ifdef TOOLS_ENABLED
+#include "editor/editor_node.h"
+#endif
+
void WindowDialog::_post_popup() {
drag_type = DRAG_NONE; // just in case
@@ -38,7 +42,7 @@ void WindowDialog::_post_popup() {
void WindowDialog::_fix_size() {
- // Perhaps this should be called when the viewport resizes aswell or windows go out of bounds...
+ // Perhaps this should be called when the viewport resizes as well or windows go out of bounds...
// Ensure the whole window is visible.
Point2i pos = get_global_pos();
@@ -199,6 +203,16 @@ void WindowDialog::_notification(int p_what) {
set_default_cursor_shape(CURSOR_ARROW);
}
} break;
+#ifdef TOOLS_ENABLED
+ case NOTIFICATION_POST_POPUP: {
+ if (get_tree() && get_tree()->is_editor_hint() && EditorNode::get_singleton())
+ EditorNode::get_singleton()->dim_editor(true);
+ } break;
+ case NOTIFICATION_POPUP_HIDE: {
+ if (get_tree() && get_tree()->is_editor_hint() && EditorNode::get_singleton())
+ EditorNode::get_singleton()->dim_editor(false);
+ } break;
+#endif
}
}