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
This commit is contained in:
commit
c74b54f229
1 changed files with 3 additions and 2 deletions
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
#include "editor/editor_node.h"
|
#include "editor/editor_node.h"
|
||||||
|
#include "scene/main/viewport.h" // Only used to check for more modals when dimming the editor.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// WindowDialog
|
// WindowDialog
|
||||||
|
@ -59,7 +60,7 @@ void WindowDialog::_fix_size() {
|
||||||
float left = 0;
|
float left = 0;
|
||||||
float bottom = 0;
|
float bottom = 0;
|
||||||
float right = 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") {
|
if (panel->get_class() == "StyleBoxTexture") {
|
||||||
Ref<StyleBoxTexture> panel_texture = Object::cast_to<StyleBoxTexture>(*panel);
|
Ref<StyleBoxTexture> panel_texture = Object::cast_to<StyleBoxTexture>(*panel);
|
||||||
top = panel_texture->get_expand_margin_size(MARGIN_TOP);
|
top = panel_texture->get_expand_margin_size(MARGIN_TOP);
|
||||||
|
@ -242,7 +243,7 @@ void WindowDialog::_notification(int p_what) {
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case NOTIFICATION_POPUP_HIDE: {
|
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);
|
EditorNode::get_singleton()->dim_editor(false);
|
||||||
} break;
|
} break;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue