diff --git a/src/editor/graph/nodes/graph_node_default.cpp b/src/editor/graph/nodes/graph_node_default.cpp index 80a0bdff..19d05672 100644 --- a/src/editor/graph/nodes/graph_node_default.cpp +++ b/src/editor/graph/nodes/graph_node_default.cpp @@ -110,6 +110,29 @@ void OrchestratorGraphNodeDefault::_update_pins() _create_row_widget(row); } + real_t max_left_width{ 0 }; + real_t max_right_width{ 0 }; + for (int row_index = 0; row_index < max_rows; row_index++) + { + if (_pin_rows[row_index].left) + max_left_width = Math::max(_pin_rows[row_index].left->get_size().x, max_left_width); + if (_pin_rows[row_index].right) + max_right_width = Math::max(_pin_rows[row_index].right->get_size().x, max_right_width); + } + for (int row_index = 0; row_index < max_rows; row_index++) + { + if (_pin_rows[row_index].left) + { + _pin_rows[row_index].left->set_custom_minimum_size(Vector2(max_left_width, 0)); + _pin_rows[row_index].left->set_alignment(BoxContainer::ALIGNMENT_BEGIN); + } + if (_pin_rows[row_index].right) + { + _pin_rows[row_index].right->set_custom_minimum_size(Vector2(max_right_width, 0)); + _pin_rows[row_index].right->set_alignment(BoxContainer::ALIGNMENT_END); + } + } + OrchestratorGraphNode::_update_pins(); } diff --git a/src/editor/graph/pins/graph_node_pin_color.cpp b/src/editor/graph/pins/graph_node_pin_color.cpp index 90ad6ca5..7e3d83ab 100644 --- a/src/editor/graph/pins/graph_node_pin_color.cpp +++ b/src/editor/graph/pins/graph_node_pin_color.cpp @@ -36,7 +36,7 @@ Control* OrchestratorGraphNodePinColor::_get_default_value_widget() { ColorPickerButton* button = memnew(ColorPickerButton); button->set_focus_mode(Control::FOCUS_NONE); - button->set_h_size_flags(Control::SIZE_EXPAND_FILL); + button->set_h_size_flags(Control::SIZE_EXPAND); button->set_custom_minimum_size(Vector2(24, 24)); button->set_pick_color(_pin->get_default_value()); button->connect("color_changed", callable_mp(this, &OrchestratorGraphNodePinColor::_on_default_value_changed)); diff --git a/src/editor/graph/pins/graph_node_pin_numeric.cpp b/src/editor/graph/pins/graph_node_pin_numeric.cpp index 460929d1..b2bc5158 100644 --- a/src/editor/graph/pins/graph_node_pin_numeric.cpp +++ b/src/editor/graph/pins/graph_node_pin_numeric.cpp @@ -60,7 +60,7 @@ Control* OrchestratorGraphNodePinNumeric::_get_default_value_widget() { LineEdit* line_edit = memnew(LineEdit); line_edit->set_expand_to_text_length_enabled(true); - line_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); + line_edit->set_h_size_flags(Control::SIZE_EXPAND); line_edit->set_text(_pin->get_effective_default_value()); line_edit->add_theme_constant_override("minimum_character_width", 0); line_edit->set_select_all_on_focus(true); diff --git a/src/editor/graph/pins/graph_node_pin_string.cpp b/src/editor/graph/pins/graph_node_pin_string.cpp index 50a64ffe..ecde9c42 100644 --- a/src/editor/graph/pins/graph_node_pin_string.cpp +++ b/src/editor/graph/pins/graph_node_pin_string.cpp @@ -60,7 +60,7 @@ Control* OrchestratorGraphNodePinString::_get_default_value_widget() { TextEdit* text_edit = memnew(TextEdit); text_edit->set_placeholder("No value..."); - text_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); + text_edit->set_h_size_flags(Control::SIZE_EXPAND); text_edit->set_v_size_flags(Control::SIZE_EXPAND); text_edit->set_h_grow_direction(Control::GROW_DIRECTION_END); text_edit->set_custom_minimum_size(Vector2(350, 0)); @@ -76,7 +76,7 @@ Control* OrchestratorGraphNodePinString::_get_default_value_widget() LineEdit* line_edit = memnew(LineEdit); line_edit->set_custom_minimum_size(Vector2(30, 0)); line_edit->set_expand_to_text_length_enabled(true); - line_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); + line_edit->set_h_size_flags(Control::SIZE_EXPAND); line_edit->set_text(_pin->get_effective_default_value()); line_edit->set_select_all_on_focus(true); line_edit->connect("text_submitted",