From 9d4a996a08e5bab69b7cb405cf7a8590e50b0fe5 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Sun, 16 Dec 2018 23:18:04 -0200 Subject: Fix titles in graph editors being invisible when headers are enabled --- editor/plugins/visual_shader_editor_plugin.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'editor/plugins/visual_shader_editor_plugin.cpp') diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index d3295c0f51..aff465728b 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -341,6 +341,18 @@ void VisualShaderEditor::_update_graph() { node->add_child(hb); node->set_slot(i + port_offset, valid_left, port_left, type_color[port_left], valid_right, port_right, type_color[port_right]); + + if (EditorSettings::get_singleton()->get("interface/theme/use_graph_node_headers")) { + Ref sb = node->get_stylebox("frame", "GraphNode"); + Color c = sb->get_border_color(MARGIN_TOP); + Color mono_color = ((c.r + c.g + c.b) / 3) < 0.7 ? Color(1.0, 1.0, 1.0) : Color(0.0, 0.0, 0.0); + mono_color.a = 0.85; + c = mono_color; + + node->add_color_override("title_color", c); + c.a = 0.7; + node->add_color_override("close_color", c); + } } if (vsnode->get_output_port_for_preview() >= 0) { @@ -605,6 +617,9 @@ void VisualShaderEditor::_notification(int p_what) { error_panel->add_style_override("panel", get_stylebox("bg", "Tree")); error_label->add_color_override("font_color", get_color("error_color", "Editor")); + + if (p_what == NOTIFICATION_THEME_CHANGED && is_visible_in_tree()) + _update_graph(); } if (p_what == NOTIFICATION_PROCESS) { -- cgit v1.2.3