Merge pull request #110218 from WhalesState/picker-shape-expand

Allow all ColorPicker Shapes to expand horizontally
This commit is contained in:
Thaddeus Crews
2025-10-28 12:19:21 -05:00
2 changed files with 3 additions and 1 deletions

View File

@ -2062,7 +2062,7 @@ ColorPicker::ColorPicker() {
internal_margin->add_child(real_vbox);
shape_container = memnew(HBoxContainer);
shape_container->set_v_size_flags(SIZE_SHRINK_BEGIN);
shape_container->set_alignment(ALIGNMENT_CENTER);
real_vbox->add_child(shape_container);
sample_hbc = memnew(HBoxContainer);

View File

@ -435,6 +435,7 @@ void ColorPickerShapeRectangle::_hue_slider_draw() {
void ColorPickerShapeRectangle::_initialize_controls() {
sv_square = memnew(Control);
sv_square->set_h_size_flags(Control::SIZE_EXPAND_FILL);
color_picker->shape_container->add_child(sv_square);
sv_square->connect(SceneStringName(gui_input), callable_mp(this, &ColorPickerShapeRectangle::_sv_square_input));
sv_square->connect(SceneStringName(draw), callable_mp(this, &ColorPickerShapeRectangle::_sv_square_draw));
@ -471,6 +472,7 @@ void ColorPickerShapeRectangle::grab_focus() {
void ColorPickerShapeOKHSRectangle::_initialize_controls() {
rectangle_margin = memnew(MarginContainer);
rectangle_margin->set_h_size_flags(Control::SIZE_EXPAND_FILL);
color_picker->shape_container->add_child(rectangle_margin);
Ref<ShaderMaterial> material;