From 6d876baf60d624d65737583c4d88d5c86c6e12cc Mon Sep 17 00:00:00 2001 From: Hendrik Brucker Date: Sat, 30 Apr 2022 03:56:57 +0200 Subject: Improve the VisualShader/VisualScript editor UI --- modules/visual_script/editor/visual_script_editor.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/visual_script/editor/visual_script_editor.cpp b/modules/visual_script/editor/visual_script_editor.cpp index 06fa90eb29..35a2bddac6 100644 --- a/modules/visual_script/editor/visual_script_editor.cpp +++ b/modules/visual_script/editor/visual_script_editor.cpp @@ -647,6 +647,14 @@ void VisualScriptEditor::_update_graph(int p_only_id) { Control::get_theme_icon(SNAME("PackedColorArray"), SNAME("EditorIcons")) }; + // Visual script specific theme for MSDF font. + Ref vstheme; + vstheme.instantiate(); + Ref label_font = EditorNode::get_singleton()->get_editor_theme()->get_font("main_msdf", "EditorFonts"); + vstheme->set_font("font", "Label", label_font); + vstheme->set_font("font", "LineEdit", label_font); + vstheme->set_font("font", "Button", label_font); + Ref seq_port = Control::get_theme_icon(SNAME("VisualShaderPort"), SNAME("EditorIcons")); List node_ids; script->get_node_list(&node_ids); @@ -960,9 +968,8 @@ void VisualScriptEditor::_update_graph(int p_only_id) { slot_idx++; } - graph->add_child(gnode); - + gnode->set_theme(vstheme); if (gnode->is_comment()) { graph->move_child(gnode, 0); } @@ -4577,6 +4584,7 @@ VisualScriptEditor::VisualScriptEditor() { add_child(graph); graph->set_v_size_flags(Control::SIZE_EXPAND_FILL); graph->set_anchors_and_offsets_preset(Control::PRESET_WIDE); + graph->set_show_zoom_label(true); graph->connect("node_selected", callable_mp(this, &VisualScriptEditor::_node_selected)); graph->connect("begin_node_move", callable_mp(this, &VisualScriptEditor::_begin_node_move)); graph->connect("end_node_move", callable_mp(this, &VisualScriptEditor::_end_node_move)); -- cgit v1.2.3