summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-09-20 17:13:44 +0200
committerGitHub <noreply@github.com>2019-09-20 17:13:44 +0200
commitc74b54f2299d4a327d959ba2f33e3e8f003df591 (patch)
tree4ee53e5e34dbd2cd5c9095a30055afe22b50fbf9 /scene
parentd364e88c2a77a5470d64b77daa588f6dbb8adbc7 (diff)
parent53c9eaf9334666b4f5d83ef26736f616d28e1c44 (diff)
Merge pull request #32197 from YeldhamDev/fix_multiple_modals_dim
Fix editor dimming being disabled when a dialog is closed even when others are open
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/dialogs.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index 59bbdad97a..9ed1d2bf45 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -35,6 +35,7 @@
#ifdef TOOLS_ENABLED
#include "editor/editor_node.h"
+#include "scene/main/viewport.h" // Only used to check for more modals when dimming the editor.
#endif
// WindowDialog
@@ -59,7 +60,7 @@ void WindowDialog::_fix_size() {
float left = 0;
float bottom = 0;
float right = 0;
- // Check validity, because the theme could contain a different type of StyleBox
+ // Check validity, because the theme could contain a different type of StyleBox.
if (panel->get_class() == "StyleBoxTexture") {
Ref<StyleBoxTexture> panel_texture = Object::cast_to<StyleBoxTexture>(*panel);
top = panel_texture->get_expand_margin_size(MARGIN_TOP);
@@ -242,7 +243,7 @@ void WindowDialog::_notification(int p_what) {
} break;
case NOTIFICATION_POPUP_HIDE: {
- if (get_tree() && Engine::get_singleton()->is_editor_hint() && EditorNode::get_singleton())
+ if (get_tree() && Engine::get_singleton()->is_editor_hint() && EditorNode::get_singleton() && !get_viewport()->gui_has_modal_stack())
EditorNode::get_singleton()->dim_editor(false);
} break;
#endif