diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2019-07-04 23:45:51 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2019-07-04 23:47:47 +0200 |
commit | 492c3196ae71218920c896f458d6501ad4cab54a (patch) | |
tree | dee0b45f2b5ce82037c25194b7f509a19f8793bb /editor/editor_node.cpp | |
parent | 550f436f8fbea86984a845c821270fba78189143 (diff) |
Dim the editor window while it's quitting
This makes it clearer that the editor window is busy while it's quitting
(which can take a while on slower PCs).
This also makes it feel more responsive to user input.
Note that the effect is only visible if
"Interface > Editor > Quit Confirmation" is disabled in the
Editor Settings, as the quit confirmation already makes
the editor window dim while quitting.
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index d9600172d7..8bf328ecc2 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2622,6 +2622,13 @@ void EditorNode::_exit_editor() { exiting = true; resource_preview->stop(); //stop early to avoid crashes _save_docks(); + + // Dim the editor window while it's quitting to make it clearer that it's busy. + // No transition is applied, as the effect needs to be visible immediately + float c = 1.0f - float(EDITOR_GET("interface/editor/dim_amount")); + Color dim_color = Color(c, c, c); + gui_base->set_modulate(dim_color); + get_tree()->quit(); } |