Skip to content

Commit de7ce9a

Browse files
committed
Reduce size changes of visual shader nodes when connecting/disconnecting
- plus small internal rename
1 parent 3978628 commit de7ce9a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

editor/plugins/visual_shader_editor_plugin.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,14 +1096,14 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
10961096
default_value = vsnode->get_input_port_default_value(j);
10971097
}
10981098

1099-
Button *button = memnew(Button);
1100-
hb->add_child(button);
1101-
register_default_input_button(p_id, j, button);
1102-
button->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_edit_port_default_input).bind(button, p_id, j));
1099+
Button *default_input_btn = memnew(Button);
1100+
hb->add_child(default_input_btn);
1101+
register_default_input_button(p_id, j, default_input_btn);
1102+
default_input_btn->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_edit_port_default_input).bind(default_input_btn, p_id, j));
11031103
if (default_value.get_type() != Variant::NIL) { // only a label
11041104
set_input_port_default_value(p_type, p_id, j, default_value);
11051105
} else {
1106-
button->hide();
1106+
default_input_btn->hide();
11071107
}
11081108

11091109
if (j == 0 && custom_editor) {
@@ -1144,7 +1144,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
11441144
Label *label = memnew(Label);
11451145
label->set_auto_translate_mode(Node::AUTO_TRANSLATE_MODE_DISABLED); // TODO: Implement proper translation switch.
11461146
label->set_text(name_left);
1147-
label->add_theme_style_override(CoreStringName(normal), editor->get_theme_stylebox(SNAME("label_style"), SNAME("VShaderEditor"))); //more compact
1147+
label->add_theme_style_override(CoreStringName(normal), editor->get_theme_stylebox(SNAME("label_style"), SNAME("VShaderEditor")));
11481148
hb->add_child(label);
11491149

11501150
if (vsnode->is_input_port_default(j, mode) && !port_left_used) {

editor/themes/editor_theme_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2346,7 +2346,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
23462346
}
23472347

23482348
// VisualShader editor.
2349-
p_theme->set_stylebox("label_style", "VShaderEditor", make_empty_stylebox(2, 1, 2, 1));
2349+
p_theme->set_stylebox("label_style", "VShaderEditor", make_empty_stylebox(4, 6, 4, 6));
23502350

23512351
// StateMachine graph.
23522352
{

0 commit comments

Comments
 (0)