From b22e266d7155886b471f6209f1e78af16674821c Mon Sep 17 00:00:00 2001 From: Mounir Tohami <53877170+WhalesState@users.noreply.github.com> Date: Thu, 4 Sep 2025 01:17:16 +0300 Subject: [PATCH] Allow all ColorPicker Shapes to expand horizontally Co-authored-by: Tomasz Chabora --- scene/gui/color_picker.cpp | 2 +- scene/gui/color_picker_shape.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 5a3d5e859d..acf2492005 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -2162,7 +2162,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); diff --git a/scene/gui/color_picker_shape.cpp b/scene/gui/color_picker_shape.cpp index ce9de12a29..e50513d9cc 100644 --- a/scene/gui/color_picker_shape.cpp +++ b/scene/gui/color_picker_shape.cpp @@ -322,6 +322,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)); @@ -358,6 +359,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 material;