Skip to content

Commit 60f6733

Browse files
committed
Merge pull request godotengine#110218 from WhalesState/picker-shape-expand
Allow all ColorPicker Shapes to expand horizontally
2 parents 597b0a2 + b22e266 commit 60f6733

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

scene/gui/color_picker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2062,7 +2062,7 @@ ColorPicker::ColorPicker() {
20622062
internal_margin->add_child(real_vbox);
20632063

20642064
shape_container = memnew(HBoxContainer);
2065-
shape_container->set_v_size_flags(SIZE_SHRINK_BEGIN);
2065+
shape_container->set_alignment(ALIGNMENT_CENTER);
20662066
real_vbox->add_child(shape_container);
20672067

20682068
sample_hbc = memnew(HBoxContainer);

scene/gui/color_picker_shape.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ void ColorPickerShapeRectangle::_hue_slider_draw() {
435435

436436
void ColorPickerShapeRectangle::_initialize_controls() {
437437
sv_square = memnew(Control);
438+
sv_square->set_h_size_flags(Control::SIZE_EXPAND_FILL);
438439
color_picker->shape_container->add_child(sv_square);
439440
sv_square->connect(SceneStringName(gui_input), callable_mp(this, &ColorPickerShapeRectangle::_sv_square_input));
440441
sv_square->connect(SceneStringName(draw), callable_mp(this, &ColorPickerShapeRectangle::_sv_square_draw));
@@ -471,6 +472,7 @@ void ColorPickerShapeRectangle::grab_focus() {
471472

472473
void ColorPickerShapeOKHSRectangle::_initialize_controls() {
473474
rectangle_margin = memnew(MarginContainer);
475+
rectangle_margin->set_h_size_flags(Control::SIZE_EXPAND_FILL);
474476
color_picker->shape_container->add_child(rectangle_margin);
475477

476478
Ref<ShaderMaterial> material;

0 commit comments

Comments
 (0)