summaryrefslogtreecommitdiff
path: root/editor/plugins/visual_shader_editor_plugin.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-08-27 21:56:14 +0200
committerGitHub <noreply@github.com>2022-08-27 21:56:14 +0200
commitd3db8bbebddc61d07179bc1acc27853813e7a2a0 (patch)
tree7deb731fd025f8c80dd362753a9821724aeb6e29 /editor/plugins/visual_shader_editor_plugin.cpp
parentc7b5c908814b830ad04c4e54c1e36da3a18aa52c (diff)
parent4b817a565cab8af648c88cfc7ab6481e86ee3625 (diff)
Merge pull request #62846 from AaronRecord/remove_redundant_theme_updates_in_enter_tree
Remove `NOTIFICATION_ENTER_TREE` when paired with `NOTIFICATION_THEME_CHANGED`
Diffstat (limited to 'editor/plugins/visual_shader_editor_plugin.cpp')
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index e048ee2698..afef0f8f45 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -1716,7 +1716,6 @@ void VisualShaderEditor::_update_graph() {
graph_plugin->clear_links();
graph_plugin->make_dirty(true);
- graph_plugin->update_theme();
for (int n_i = 0; n_i < nodes.size(); n_i++) {
graph_plugin->add_node(type, nodes[n_i]);
@@ -3704,9 +3703,11 @@ void VisualShaderEditor::_notification(int p_what) {
graph->get_panner()->setup((ViewPanner::ControlScheme)EDITOR_GET("editors/panning/sub_editors_panning_scheme").operator int(), ED_GET_SHORTCUT("canvas_item_editor/pan_view"), bool(EditorSettings::get_singleton()->get("editors/panning/simple_panning")));
graph->set_warped_panning(bool(EditorSettings::get_singleton()->get("editors/panning/warped_mouse_panning")));
- [[fallthrough]];
- }
+ } break;
+
case NOTIFICATION_THEME_CHANGED: {
+ graph_plugin->update_theme();
+
highend_label->set_modulate(get_theme_color(SNAME("vulkan_color"), SNAME("Editor")));
node_filter->set_right_icon(Control::get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
@@ -3759,7 +3760,7 @@ void VisualShaderEditor::_notification(int p_what) {
tools->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("Tools"), SNAME("EditorIcons")));
- if (p_what == NOTIFICATION_THEME_CHANGED && is_visible_in_tree()) {
+ if (is_visible_in_tree()) {
_update_graph();
}
} break;