bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f34f92bb29724c8e2c796c9787c2572d29d6619d
commit f34f92bb29724c8e2c796c9787c2572d29d6619d Author: Mike Blumenkrantz <[email protected]> Date: Mon Aug 5 09:13:05 2019 -0400 efl_ui: use unified size hints api and be explicit about which hint is changed unified widgets should use unified api internally and also be more explicit about which min size hint (restricted or user) is being set in order to improve readability of code when unified widgets also implement legacy wrappers, legacy api should be used for the legacy objects no functional changes Reviewed-by: Marcel Hollerbach <[email protected]> Differential Revision: https://phab.enlightenment.org/D9495 --- src/lib/elementary/efl_ui_flip.c | 5 ++++- src/lib/elementary/efl_ui_frame.c | 5 ++++- src/lib/elementary/efl_ui_image.c | 5 ++++- src/lib/elementary/efl_ui_image_zoomable.c | 12 +++++++++--- src/lib/elementary/efl_ui_list_view.c | 2 +- src/lib/elementary/efl_ui_panel.c | 12 ++++++------ src/lib/elementary/efl_ui_panes.c | 6 +++--- src/lib/elementary/efl_ui_progressbar.c | 24 ++++++++++++------------ src/lib/elementary/efl_ui_tags.c | 2 +- src/lib/elementary/efl_ui_textpath.c | 2 +- src/lib/elementary/efl_ui_win.c | 2 +- 11 files changed, 46 insertions(+), 31 deletions(-) diff --git a/src/lib/elementary/efl_ui_flip.c b/src/lib/elementary/efl_ui_flip.c index 23ce004d32..d6e9152146 100644 --- a/src/lib/elementary/efl_ui_flip.c +++ b/src/lib/elementary/efl_ui_flip.c @@ -93,7 +93,10 @@ _sizing_eval(Evas_Object *obj) elm_coords_finger_size_adjust(fingx, &minw, fingy, &minh); - evas_object_size_hint_min_set(obj, minw, minh); + if (elm_widget_is_legacy(obj)) + evas_object_size_hint_min_set(obj, minw, minh); + else + efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); evas_object_size_hint_max_set(obj, maxw, maxh); } diff --git a/src/lib/elementary/efl_ui_frame.c b/src/lib/elementary/efl_ui_frame.c index 4f8891a0cc..1f167fb495 100644 --- a/src/lib/elementary/efl_ui_frame.c +++ b/src/lib/elementary/efl_ui_frame.c @@ -38,7 +38,10 @@ _sizing_eval(Evas_Object *obj, evas_object_size_hint_min_get(obj, &cminw, &cminh); if ((minw == cminw) && (minh == cminh)) return; - evas_object_size_hint_min_set(obj, minw, minh); + if (elm_widget_is_legacy(obj)) + evas_object_size_hint_min_set(obj, minw, minh); + else + efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); evas_object_size_hint_max_set(obj, -1, -1); } diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c index 342c9d2d56..68403700be 100644 --- a/src/lib/elementary/efl_ui_image.c +++ b/src/lib/elementary/efl_ui_image.c @@ -802,7 +802,10 @@ _efl_ui_image_sizing_eval(Evas_Object *obj) } } - evas_object_size_hint_min_set(obj, minw, minh); + if (elm_widget_is_legacy(obj)) + evas_object_size_hint_min_set(obj, minw, minh); + else + efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); evas_object_size_hint_max_set(obj, maxw, maxh); if (sd->img) diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c index 6b529d210d..4b76f6bde4 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -116,7 +116,10 @@ _sizing_eval(Evas_Object *obj) evas_object_size_hint_max_get (wd->resize_obj, &maxw, &maxh); - evas_object_size_hint_min_set(obj, minw, minh); + if (elm_widget_is_legacy(obj)) + evas_object_size_hint_min_set(obj, minw, minh); + else + efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); evas_object_size_hint_max_set(obj, maxw, maxh); } @@ -1861,7 +1864,10 @@ _efl_ui_image_zoomable_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Image_Zoomable (priv->img, EVAS_CALLBACK_IMAGE_PRELOADED, _main_img_preloaded_cb, obj); edje_object_size_min_calc(edje, &minw, &minh); - evas_object_size_hint_min_set(obj, minw, minh); + if (elm_widget_is_legacy(obj)) + evas_object_size_hint_min_set(obj, minw, minh); + else + efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); _efl_ui_image_zoomable_edje_object_attach(obj); @@ -2028,7 +2034,7 @@ _img_proxy_set(Evas_Object *obj, Efl_Ui_Image_Zoomable_Data *sd, evas_object_image_source_set(sd->img, sd->edje); evas_object_image_source_visible_set(sd->img, EINA_FALSE); - evas_object_size_hint_min_set(sd->img, w, h); + efl_gfx_hint_size_min_set(sd->img, EINA_SIZE2D(w, h)); evas_object_show(sd->img); evas_object_show(sd->edje); diff --git a/src/lib/elementary/efl_ui_list_view.c b/src/lib/elementary/efl_ui_list_view.c index 0a686e740a..78812853ae 100644 --- a/src/lib/elementary/efl_ui_list_view.c +++ b/src/lib/elementary/efl_ui_list_view.c @@ -862,7 +862,7 @@ _efl_ui_list_view_efl_ui_list_view_model_min_size_set(Eo *obj, Efl_Ui_List_View_ pd->min.w = min.w; pd->min.h = min.h; - evas_object_size_hint_min_set(wd->resize_obj, pd->min.w, pd->min.h); + efl_gfx_hint_size_min_set(wd->resize_obj, EINA_SIZE2D(pd->min.w, pd->min.h)); efl_event_callback_call(pd->pan_obj, EFL_UI_PAN_EVENT_PAN_CONTENT_CHANGED, NULL); } diff --git a/src/lib/elementary/efl_ui_panel.c b/src/lib/elementary/efl_ui_panel.c index cad4a8f807..1f6f21da8c 100644 --- a/src/lib/elementary/efl_ui_panel.c +++ b/src/lib/elementary/efl_ui_panel.c @@ -228,7 +228,7 @@ _efl_ui_panel_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Panel_Data *sd) evas_object_hide(sd->event); elm_coords_finger_size_adjust(1, &minw, 1, &minh); - evas_object_size_hint_min_set(sd->event, minw, minh); + efl_gfx_hint_size_min_set(sd->event, EINA_SIZE2D(minw, minh)); if (edje_object_part_exists(wd->resize_obj, "efl.swallow.event")) efl_content_set(efl_part(efl_super(obj, MY_CLASS), "efl.swallow.event"), sd->event); @@ -770,15 +770,15 @@ _scrollable_layout_resize(Eo *obj, Efl_Ui_Panel_Data *sd, Evas_Coord w, Evas_Coo case EFL_UI_PANEL_ORIENT_BOTTOM: // vertical evas_object_resize(sd->scr_ly, w, (1 + sd->content_size_ratio) * h); - evas_object_size_hint_min_set(sd->scr_panel, w, (sd->content_size_ratio * h)); - evas_object_size_hint_min_set(sd->scr_event, w, h); + efl_gfx_hint_size_min_set(sd->scr_panel, EINA_SIZE2D(w, (sd->content_size_ratio * h))); + efl_gfx_hint_size_min_set(sd->scr_event, EINA_SIZE2D(w, h)); break; case EFL_UI_PANEL_ORIENT_LEFT: case EFL_UI_PANEL_ORIENT_RIGHT: // horizontal evas_object_resize(sd->scr_ly, (1 + sd->content_size_ratio) * w, h); - evas_object_size_hint_min_set(sd->scr_panel, (sd->content_size_ratio * w), h); - evas_object_size_hint_min_set(sd->scr_event, w, h); + efl_gfx_hint_size_min_set(sd->scr_panel, EINA_SIZE2D((sd->content_size_ratio * w), h)); + efl_gfx_hint_size_min_set(sd->scr_event, EINA_SIZE2D(w, h)); break; } efl_canvas_group_change(obj); @@ -868,7 +868,7 @@ _efl_ui_panel_efl_object_constructor(Eo *obj, Efl_Ui_Panel_Data *_pd) Evas_Coord minw = 0, minh = 0; elm_coords_finger_size_adjust(1, &minw, 1, &minh); - evas_object_size_hint_min_set(_pd->event, minw, minh); + efl_gfx_hint_size_min_set(_pd->event, EINA_SIZE2D(minw, minh)); efl_content_set(efl_part(efl_super(obj, MY_CLASS), "efl.swallow.event"), _pd->event); } } diff --git a/src/lib/elementary/efl_ui_panes.c b/src/lib/elementary/efl_ui_panes.c index 30f5770a90..3b6db20f40 100644 --- a/src/lib/elementary/efl_ui_panes.c +++ b/src/lib/elementary/efl_ui_panes.c @@ -129,7 +129,7 @@ _efl_ui_panes_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Panes_Data *sd) evas_object_hide(sd->event); elm_coords_finger_size_adjust(1, &minw, 1, &minh); - evas_object_size_hint_min_set(sd->event, minw, minh); + efl_gfx_hint_size_min_set(sd->event, EINA_SIZE2D(minw, minh)); int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; @@ -468,7 +468,7 @@ _efl_ui_panes_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Panes_Data *_pd EINA_UN Evas_Coord minw = 0, minh = 0; elm_coords_finger_size_adjust(1, &minw, 1, &minh); - evas_object_size_hint_min_set(sd->event, minw, minh); + efl_gfx_hint_size_min_set(sd->event, EINA_SIZE2D(minw, minh)); elm_layout_content_set(obj, "elm.swallow.event", sd->event); } } @@ -480,7 +480,7 @@ _efl_ui_panes_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Panes_Data *_pd EINA_UN Evas_Coord minw = 0, minh = 0; elm_coords_finger_size_adjust(1, &minw, 1, &minh); - evas_object_size_hint_min_set(sd->event, minw, minh); + efl_gfx_hint_size_min_set(sd->event, EINA_SIZE2D(minw, minh)); elm_layout_content_set(obj, "efl.event", sd->event); } } diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c index f80b40badb..4ea4b26482 100644 --- a/src/lib/elementary/efl_ui_progressbar.c +++ b/src/lib/elementary/efl_ui_progressbar.c @@ -249,13 +249,13 @@ _efl_ui_progressbar_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data * sd->has_cur_progressbar_part = edje_object_part_exists(obj, curprogresspart[elm_widget_is_legacy(obj)]); if (_is_horizontal(sd->dir)) - evas_object_size_hint_min_set - (sd->spacer, (double)sd->size * efl_gfx_entity_scale_get(obj) * - elm_config_scale_get(), 1); + efl_gfx_hint_size_min_set + (sd->spacer, EINA_SIZE2D((double)sd->size * efl_gfx_entity_scale_get(obj) * + elm_config_scale_get(), 1)); else - evas_object_size_hint_min_set - (sd->spacer, 1, (double)sd->size * efl_gfx_entity_scale_get(obj) * - elm_config_scale_get()); + efl_gfx_hint_size_min_set + (sd->spacer, EINA_SIZE2D(1, (double)sd->size * efl_gfx_entity_scale_get(obj) * + elm_config_scale_get())); if (elm_widget_is_legacy(obj)) { @@ -447,13 +447,13 @@ _progressbar_span_size_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Evas_Coord size sd->size = size; if (_is_horizontal(sd->dir)) - evas_object_size_hint_min_set - (sd->spacer, (double)sd->size * efl_gfx_entity_scale_get(obj) * - elm_config_scale_get(), 1); + efl_gfx_hint_size_min_set + (sd->spacer, EINA_SIZE2D((double)sd->size * efl_gfx_entity_scale_get(obj) * + elm_config_scale_get(), 1)); else - evas_object_size_hint_min_set - (sd->spacer, 1, (double)sd->size * efl_gfx_entity_scale_get(obj) * - elm_config_scale_get()); + efl_gfx_hint_size_min_set + (sd->spacer, EINA_SIZE2D(1, (double)sd->size * efl_gfx_entity_scale_get(obj) * + elm_config_scale_get())); efl_canvas_group_change(obj); } diff --git a/src/lib/elementary/efl_ui_tags.c b/src/lib/elementary/efl_ui_tags.c index f4a10b48a5..b06e4a512f 100644 --- a/src/lib/elementary/efl_ui_tags.c +++ b/src/lib/elementary/efl_ui_tags.c @@ -719,7 +719,7 @@ _label_set(Evas_Object *obj, efl_pack_unpack(sd->box, sd->label); sd->label_packed = EINA_TRUE; edje_object_size_min_calc(sd->label, &width, &height); - evas_object_size_hint_min_set(sd->label, width, height); + efl_gfx_hint_size_min_set(sd->label, EINA_SIZE2D(width, height)); efl_pack_begin(sd->box, sd->label); evas_object_show(sd->label); } diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c index bfd51ee008..cee16ffe29 100644 --- a/src/lib/elementary/efl_ui_textpath.c +++ b/src/lib/elementary/efl_ui_textpath.c @@ -552,7 +552,7 @@ _ellipsis_set(Efl_Ui_Textpath_Data *pd, Eo *obj) tb = edje_object_part_object_get(pd->text_obj, "efl.text"); evas_object_textblock_size_native_get(tb, &w, &h); - evas_object_size_hint_min_set(pd->text_obj, w, h); + efl_gfx_hint_size_restricted_min_set(pd->text_obj, EINA_SIZE2D(w, h)); if (pd->ellipsis) { if (w > pd->total_length) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index e496515015..22ed4f1962 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -5024,7 +5024,7 @@ _indicator_resized(void *data, const Efl_Event *event) ELM_WIN_DATA_GET_OR_RETURN(data, sd); Evas_Object *indicator = event->object; Evas_Coord_Size *size = (Evas_Coord_Size *)event->info; - efl_gfx_hint_size_restricted_min_set(indicator, EINA_SIZE2D(size->w, size->h)); + efl_gfx_hint_size_min_set(indicator, EINA_SIZE2D(size->w, size->h)); _elm_win_frame_obj_update(sd, 0); } --
