Merge pull request #84535 from DinDotDout/ColorPicker-shape-icon-fix

Fix `ColorPicker` shape icon is invisible until shape is changed
This commit is contained in:
Yuri Sizov 2023-11-07 12:54:31 +01:00
commit c3111c3e1a

View file

@ -89,6 +89,10 @@ void ColorPicker::_notification(int p_what) {
shape_popup->set_item_icon(shape_popup->get_item_index(SHAPE_VHS_CIRCLE), theme_cache.shape_circle);
shape_popup->set_item_icon(shape_popup->get_item_index(SHAPE_OKHSL_CIRCLE), theme_cache.shape_circle);
if (current_shape != SHAPE_NONE) {
btn_shape->set_icon(shape_popup->get_item_icon(current_shape));
}
internal_margin->begin_bulk_theme_override();
internal_margin->add_theme_constant_override(SNAME("margin_bottom"), theme_cache.content_margin);
internal_margin->add_theme_constant_override(SNAME("margin_left"), theme_cache.content_margin);
@ -1792,8 +1796,6 @@ ColorPicker::ColorPicker() {
shape_popup->set_item_checked(current_shape, true);
shape_popup->connect("id_pressed", callable_mp(this, &ColorPicker::set_picker_shape));
btn_shape->set_icon(shape_popup->get_item_icon(current_shape));
add_mode(new ColorModeRGB(this));
add_mode(new ColorModeHSV(this));
add_mode(new ColorModeRAW(this));