cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=02f1ce8d54096e9de7088c8f09981178306afeed
commit 02f1ce8d54096e9de7088c8f09981178306afeed Author: Mike Blumenkrantz <zm...@samsung.com> Date: Wed Jul 31 14:36:13 2019 -0400 elm/colorselector: go back to using elm_box internally legacy widgets should not use efl_ui widgets internally and vice versa reverts b11f3717036bc4675fde5ffbc26775262a184465 Reviewed-by: Cedric BAIL <cedric.b...@free.fr> Differential Revision: https://phab.enlightenment.org/D9465 --- src/lib/elementary/elm_colorselector.c | 40 +++++++++++++--------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/src/lib/elementary/elm_colorselector.c b/src/lib/elementary/elm_colorselector.c index c45bedba61..eee8ea076d 100644 --- a/src/lib/elementary/elm_colorselector.c +++ b/src/lib/elementary/elm_colorselector.c @@ -1348,9 +1348,8 @@ _elm_colorselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Colorselector_Data *sd vpadstr = edje_object_data_get (wd->resize_obj, "vertical_pad"); if (vpadstr) v_pad = atoi(vpadstr); - scale = efl_gfx_entity_scale_get(obj) * elm_config_scale_get() / edje_object_base_scale_get(wd->resize_obj); - efl_gfx_arrangement_content_padding_set(sd->palette_box, h_pad * scale, v_pad * scale, 0); + elm_box_padding_set(sd->palette_box, h_pad * scale, v_pad * scale); EINA_LIST_FOREACH(sd->items, elist, eo_item) { @@ -1535,7 +1534,7 @@ _elm_colorselector_efl_canvas_group_calculate(Eo *obj, Elm_Colorselector_Data *s return; } - efl_pack_layout_request(sd->palette_box); + efl_canvas_group_calculate(sd->palette_box); edje_object_size_min_calc(wd->resize_obj, &minw, &minh); evas_object_size_hint_min_set(obj, minw, minh); } @@ -1873,7 +1872,7 @@ _palette_colors_load(Evas_Object *obj) item->color->b = color->b; item->color->a = color->a; - efl_pack(sd->palette_box, VIEW(item)); + elm_box_pack_end(sd->palette_box, VIEW(item)); evas_object_color_set(item->color_obj, (item->color->r * item->color->a) / 255, (item->color->g * item->color->a) / 255, @@ -1886,14 +1885,6 @@ _palette_colors_load(Evas_Object *obj) sd->config_load = EINA_TRUE; } -static inline void -_palette_box_prepare(Eo *o) -{ - efl_ui_layout_orientation_set(o, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL); - efl_gfx_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_entity_visible_set(o, EINA_FALSE); -} - static void _create_colorpalette(Evas_Object *obj) { @@ -1906,16 +1897,15 @@ _create_colorpalette(Evas_Object *obj) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); if (sd->palette_box) return; - if (elm_widget_is_legacy(obj)) - { - sd->palette_box = elm_legacy_add(EFL_UI_BOX_FLOW_CLASS, obj); - evas_object_size_hint_align_set(sd->palette_box, EVAS_HINT_FILL, EVAS_HINT_FILL); - } - else - { - sd->palette_box = efl_add(EFL_UI_BOX_FLOW_CLASS, obj); - } - _palette_box_prepare(sd->palette_box); + sd->palette_box = elm_box_add(obj); + elm_box_layout_set + (sd->palette_box, evas_object_box_layout_flow_horizontal, NULL, NULL); + elm_box_horizontal_set(sd->palette_box, EINA_TRUE); + evas_object_size_hint_weight_set + (sd->palette_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set + (sd->palette_box, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_box_homogeneous_set(sd->palette_box, EINA_TRUE); hpadstr = edje_object_data_get(wd->resize_obj, "horizontal_pad"); if (hpadstr) h_pad = atoi(hpadstr); @@ -1923,8 +1913,8 @@ _create_colorpalette(Evas_Object *obj) if (vpadstr) v_pad = atoi(vpadstr); scale = efl_gfx_entity_scale_get(obj) * elm_config_scale_get() / edje_object_base_scale_get(wd->resize_obj); - efl_gfx_arrangement_content_padding_set(sd->palette_box, h_pad * scale, v_pad * scale, 0); - efl_gfx_arrangement_content_align_set(sd->palette_box, 0.0, 0.0); + elm_box_padding_set(sd->palette_box, h_pad * scale, v_pad * scale); + elm_box_align_set(sd->palette_box, 0.0, 0.0); if (!elm_layout_content_set(obj, "elm.palette", sd->palette_box)) elm_layout_content_set(obj, "palette", sd->palette_box); sd->palette_name = eina_stringshare_add("default"); @@ -2465,7 +2455,7 @@ _elm_colorselector_palette_color_add(Eo *obj, Elm_Colorselector_Data *sd, int r, item->color->b = b; item->color->a = a; - efl_pack(sd->palette_box, VIEW(item)); + elm_box_pack_end(sd->palette_box, VIEW(item)); evas_object_color_set(item->color_obj, (item->color->r * item->color->a) / 255, (item->color->g * item->color->a) / 255, --