summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-06-13 10:07:58 +0200
committerGitHub <noreply@github.com>2019-06-13 10:07:58 +0200
commit006df1f2bcdf6333ab76a7ab188b038f0dd1b9a1 (patch)
tree7ab5dbf56ac51874fbaa7ad5561252a8f04a47ca /editor
parent6effe33bba25770c2b16c50ee037aef4194f0a2a (diff)
parentc9bc807ce46361e6cf0953ecc30a599646e2947b (diff)
Merge pull request #29636 from Calinou/project-manager-dim-window-quitting
Dim the project manager window while it's quitting
Diffstat (limited to 'editor')
-rw-r--r--editor/project_manager.cpp19
-rw-r--r--editor/project_manager.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 7b521aba13..3fd497ed7b 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -961,9 +961,25 @@ void ProjectManager::_notification(int p_what) {
set_process_unhandled_input(is_visible_in_tree());
} break;
+ case NOTIFICATION_WM_QUIT_REQUEST: {
+
+ _dim_window();
+ } break;
}
}
+void ProjectManager::_dim_window() {
+
+ // This method must be called before calling `get_tree()->quit()`.
+ // Otherwise, its effect won't be visible
+
+ // Dim the project manager 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);
+}
+
void ProjectManager::_panel_draw(Node *p_hb) {
HBoxContainer *hb = Object::cast_to<HBoxContainer>(p_hb);
@@ -1514,6 +1530,7 @@ void ProjectManager::_open_selected_projects() {
ERR_FAIL_COND(err);
}
+ _dim_window();
get_tree()->quit();
}
@@ -1780,11 +1797,13 @@ void ProjectManager::_restart_confirm() {
Error err = OS::get_singleton()->execute(exec, args, false, &pid);
ERR_FAIL_COND(err);
+ _dim_window();
get_tree()->quit();
}
void ProjectManager::_exit_dialog() {
+ _dim_window();
get_tree()->quit();
}
diff --git a/editor/project_manager.h b/editor/project_manager.h
index fa878e75a6..a7cc6549f5 100644
--- a/editor/project_manager.h
+++ b/editor/project_manager.h
@@ -110,6 +110,7 @@ class ProjectManager : public Control {
void _install_project(const String &p_zip_path, const String &p_title);
+ void _dim_window();
void _panel_draw(Node *p_hb);
void _panel_input(const Ref<InputEvent> &p_ev, Node *p_hb);
void _unhandled_input(const Ref<InputEvent> &p_ev);