diff options
author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2023-01-11 19:14:43 +0100 |
---|---|---|
committer | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2023-01-12 21:42:51 +0100 |
commit | d0e37cd04c5a5a2f3dbd15ab192a70ddd02710a0 (patch) | |
tree | 94500a37cfb31e4bc8f16341eb2cc8420e1a078c /editor | |
parent | 73ab51465748a15ed4d80d66a44db83bfe574bb6 (diff) |
Add framework for avoidance of color flash in new windows
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_node.cpp | 2 | ||||
-rw-r--r-- | editor/editor_themes.cpp | 1 | ||||
-rw-r--r-- | editor/project_manager.cpp | 5 |
3 files changed, 6 insertions, 2 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index ab79031ad2..379ad33913 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -688,6 +688,7 @@ void EditorNode::_notification(int p_what) { if (theme_changed) { theme = create_custom_theme(theme_base->get_theme()); + DisplayServer::set_early_window_clear_color_override(true, theme->get_color(SNAME("background"), SNAME("Editor"))); theme_base->set_theme(theme); gui_base->set_theme(theme); @@ -6235,6 +6236,7 @@ EditorNode::EditorNode() { // Exporters might need the theme. EditorColorMap::create(); theme = create_custom_theme(); + DisplayServer::set_early_window_clear_color_override(true, theme->get_color(SNAME("background"), SNAME("Editor"))); register_exporters(); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index d8252bed9c..7a880d2ab3 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -753,6 +753,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // Editor background Color background_color_opaque = background_color; background_color_opaque.a = 1.0; + theme->set_color("background", "Editor", background_color_opaque); theme->set_stylebox("Background", "EditorStyles", make_flat_stylebox(background_color_opaque, default_margin_size, default_margin_size, default_margin_size, default_margin_size)); // Focus diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index b4ffc7d78d..c3ca6ca303 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -2653,8 +2653,9 @@ ProjectManager::ProjectManager() { AcceptDialog::set_swap_cancel_ok(swap_cancel_ok == 2); } - set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT); - set_theme(create_custom_theme()); + Ref<Theme> theme = create_custom_theme(); + set_theme(theme); + DisplayServer::set_early_window_clear_color_override(true, theme->get_color(SNAME("background"), SNAME("Editor"))); set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT); |