Merge pull request #68255 from jbcolli2/ColorPickerBug

Fixed Issue #68194 involving ColorPicker being allowed to align horizontally when it shouldn't
This commit is contained in:
Rémi Verschelde 2022-12-21 22:25:14 +01:00
commit b04bc49443
No known key found for this signature in database
GPG key ID: C3336907360768E1
3 changed files with 4 additions and 6 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ColorPicker" inherits="BoxContainer" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<class name="ColorPicker" inherits="VBoxContainer" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Color picker control.
</brief_description>
@ -88,7 +88,6 @@
<member name="sliders_visible" type="bool" setter="set_sliders_visible" getter="are_sliders_visible" default="true">
If [code]true[/code], the color sliders are visible.
</member>
<member name="vertical" type="bool" setter="set_vertical" getter="is_vertical" overrides="BoxContainer" default="true" />
</members>
<signals>
<signal name="color_changed">

View file

@ -1577,8 +1577,7 @@ void ColorPicker::_bind_methods() {
BIND_ENUM_CONSTANT(SHAPE_NONE);
}
ColorPicker::ColorPicker() :
BoxContainer(true) {
ColorPicker::ColorPicker() {
HBoxContainer *hb_edit = memnew(HBoxContainer);
add_child(hb_edit, false, INTERNAL_MODE_FRONT);
hb_edit->set_v_size_flags(SIZE_SHRINK_BEGIN);

View file

@ -68,8 +68,8 @@ public:
~ColorPresetButton();
};
class ColorPicker : public BoxContainer {
GDCLASS(ColorPicker, BoxContainer);
class ColorPicker : public VBoxContainer {
GDCLASS(ColorPicker, VBoxContainer);
public:
enum ColorModeType {