Skip to content

Commit b22e266

Browse files
WhalesStateKoBeWi
andcommitted
Allow all ColorPicker Shapes to expand horizontally
Co-authored-by: Tomasz Chabora <[email protected]>
1 parent 6efa557 commit b22e266

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
@@ -2162,7 +2162,7 @@ ColorPicker::ColorPicker() {
21622162
internal_margin->add_child(real_vbox);
21632163

21642164
shape_container = memnew(HBoxContainer);
2165-
shape_container->set_v_size_flags(SIZE_SHRINK_BEGIN);
2165+
shape_container->set_alignment(ALIGNMENT_CENTER);
21662166
real_vbox->add_child(shape_container);
21672167

21682168
sample_hbc = memnew(HBoxContainer);

scene/gui/color_picker_shape.cpp

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

323323
void ColorPickerShapeRectangle::_initialize_controls() {
324324
sv_square = memnew(Control);
325+
sv_square->set_h_size_flags(Control::SIZE_EXPAND_FILL);
325326
color_picker->shape_container->add_child(sv_square);
326327
sv_square->connect(SceneStringName(gui_input), callable_mp(this, &ColorPickerShapeRectangle::_sv_square_input));
327328
sv_square->connect(SceneStringName(draw), callable_mp(this, &ColorPickerShapeRectangle::_sv_square_draw));
@@ -358,6 +359,7 @@ void ColorPickerShapeRectangle::grab_focus() {
358359

359360
void ColorPickerShapeOKHSRectangle::_initialize_controls() {
360361
rectangle_margin = memnew(MarginContainer);
362+
rectangle_margin->set_h_size_flags(Control::SIZE_EXPAND_FILL);
361363
color_picker->shape_container->add_child(rectangle_margin);
362364

363365
Ref<ShaderMaterial> material;

0 commit comments

Comments
 (0)