mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	Fix titles in graph editors being invisible when headers are enabled
This commit is contained in:
		
							parent
							
								
									20379119c3
								
							
						
					
					
						commit
						9d4a996a08
					
				
					 5 changed files with 32 additions and 19 deletions
				
			
		|  | @ -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<StyleBoxFlat> 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) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Michael Alexsander Silva Dias
						Michael Alexsander Silva Dias