Reduce size changes of visual shader nodes when connecting/disconnecting
- plus small internal rename
This commit is contained in:
parent
3978628c6c
commit
de7ce9a85f
@ -1096,14 +1096,14 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
|
|||||||
default_value = vsnode->get_input_port_default_value(j);
|
default_value = vsnode->get_input_port_default_value(j);
|
||||||
}
|
}
|
||||||
|
|
||||||
Button *button = memnew(Button);
|
Button *default_input_btn = memnew(Button);
|
||||||
hb->add_child(button);
|
hb->add_child(default_input_btn);
|
||||||
register_default_input_button(p_id, j, button);
|
register_default_input_button(p_id, j, default_input_btn);
|
||||||
button->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_edit_port_default_input).bind(button, p_id, j));
|
default_input_btn->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_edit_port_default_input).bind(default_input_btn, p_id, j));
|
||||||
if (default_value.get_type() != Variant::NIL) { // only a label
|
if (default_value.get_type() != Variant::NIL) { // only a label
|
||||||
set_input_port_default_value(p_type, p_id, j, default_value);
|
set_input_port_default_value(p_type, p_id, j, default_value);
|
||||||
} else {
|
} else {
|
||||||
button->hide();
|
default_input_btn->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j == 0 && custom_editor) {
|
if (j == 0 && custom_editor) {
|
||||||
@ -1144,7 +1144,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
|
|||||||
Label *label = memnew(Label);
|
Label *label = memnew(Label);
|
||||||
label->set_auto_translate_mode(Node::AUTO_TRANSLATE_MODE_DISABLED); // TODO: Implement proper translation switch.
|
label->set_auto_translate_mode(Node::AUTO_TRANSLATE_MODE_DISABLED); // TODO: Implement proper translation switch.
|
||||||
label->set_text(name_left);
|
label->set_text(name_left);
|
||||||
label->add_theme_style_override(CoreStringName(normal), editor->get_theme_stylebox(SNAME("label_style"), SNAME("VShaderEditor"))); //more compact
|
label->add_theme_style_override(CoreStringName(normal), editor->get_theme_stylebox(SNAME("label_style"), SNAME("VShaderEditor")));
|
||||||
hb->add_child(label);
|
hb->add_child(label);
|
||||||
|
|
||||||
if (vsnode->is_input_port_default(j, mode) && !port_left_used) {
|
if (vsnode->is_input_port_default(j, mode) && !port_left_used) {
|
||||||
|
@ -2346,7 +2346,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VisualShader editor.
|
// VisualShader editor.
|
||||||
p_theme->set_stylebox("label_style", "VShaderEditor", make_empty_stylebox(2, 1, 2, 1));
|
p_theme->set_stylebox("label_style", "VShaderEditor", make_empty_stylebox(4, 6, 4, 6));
|
||||||
|
|
||||||
// StateMachine graph.
|
// StateMachine graph.
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user