1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

Editor: Dim UI when a WindowDialog is shown.

Darkens the editor on WindowDialog popup.

This adds the following new Editor settings:

- interface/dim_editor_on_dialog_popup (true) # Enable/Disable editor dimming
- interface/dim_amount (0.6) # Percentage of how much the editor will be darkened (0-1)
- interface/dim_transition_time # The duration (in seconds) of the color blending effect (0-1), 0 is instant.

Please test this thoroughly, I haven't yet seen a case where it fails to work properly but I'm sure I didn't test all
windows of the editor :P
This commit is contained in:
Andreas Haas
2017-03-06 20:11:56 +01:00
parent 15c4d5006e
commit 9080232f17
4 changed files with 74 additions and 0 deletions

View File

@@ -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
@@ -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()->dim_editor(true);
} break;
case NOTIFICATION_POPUP_HIDE: {
if (get_tree() && get_tree()->is_editor_hint())
EditorNode::get_singleton()->dim_editor(false);
} break;
#endif
}
}