diff --git a/src/lib/elementary/efl_ui_anchor_popup.c b/src/lib/elementary/efl_ui_anchor_popup.c index 5709956dfd..47bf9a5b19 100644 --- a/src/lib/elementary/efl_ui_anchor_popup.c +++ b/src/lib/elementary/efl_ui_anchor_popup.c @@ -20,6 +20,8 @@ _anchor_calc(Eo *obj) EFL_UI_POPUP_DATA_GET_OR_RETURN(obj, ppd); EFL_UI_ANCHOR_POPUP_DATA_GET(obj, pd); + if (!pd->anchor) return; + Eina_Position2D pos = {0, 0}; Eina_Rect a_geom = efl_gfx_entity_geometry_get(pd->anchor); @@ -209,11 +211,7 @@ _anchor_del_cb(void *data, const Efl_Event *ev EINA_UNUSED) efl_event_callback_del(ppd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, data); pd->anchor = NULL; - //Add align calc only - Eina_Bool needs_size_calc = ppd->needs_size_calc; - efl_canvas_group_change(data); - efl_canvas_group_calculate(data); - ppd->needs_size_calc = needs_size_calc; + _anchor_calc(data); } static void @@ -246,11 +244,7 @@ _efl_ui_anchor_popup_anchor_set(Eo *obj, Efl_Ui_Anchor_Popup_Data *pd, Eo *ancho efl_event_callback_add(anchor, EFL_EVENT_DEL, _anchor_del_cb, obj); } - //Add align/anchor calc only - Eina_Bool needs_size_calc = ppd->needs_size_calc; - efl_canvas_group_change(obj); - efl_canvas_group_calculate(obj); - ppd->needs_size_calc = needs_size_calc; + _anchor_calc(obj); } EOLIAN static Efl_Object * @@ -302,23 +296,13 @@ _efl_ui_anchor_popup_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Anchor_Popup_Da } EOLIAN static void -_efl_ui_anchor_popup_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Anchor_Popup_Data *pd) +_efl_ui_anchor_popup_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Anchor_Popup_Data *pd EINA_UNUSED) { - EFL_UI_POPUP_DATA_GET_OR_RETURN(obj, ppd); - /* When efl_canvas_group_change() is called, just flag is set instead of size - * calculation. - * The actual size calculation is done here when the object is rendered to - * avoid duplicate size calculations. */ - if (ppd->needs_group_calc) - { - if (pd->anchor) - ppd->needs_align_calc = EINA_FALSE; + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); - efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); + efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); - if (pd->anchor) - _anchor_calc(obj); - } + _anchor_calc(obj); } EOLIAN static Eo * diff --git a/src/lib/elementary/efl_ui_box.c b/src/lib/elementary/efl_ui_box.c index 9db283ba6f..58b77f1d40 100644 --- a/src/lib/elementary/efl_ui_box.c +++ b/src/lib/elementary/efl_ui_box.c @@ -131,6 +131,7 @@ _efl_ui_box_efl_pack_layout_layout_update(Eo *obj, Efl_Ui_Box_Data *pd) EOLIAN static void _efl_ui_box_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED) { + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); efl_pack_layout_update(obj); } diff --git a/src/lib/elementary/efl_ui_button.c b/src/lib/elementary/efl_ui_button.c index b818ded895..8292d2985f 100644 --- a/src/lib/elementary/efl_ui_button.c +++ b/src/lib/elementary/efl_ui_button.c @@ -84,18 +84,6 @@ _activate(Evas_Object *obj) } } -EOLIAN static void -_efl_ui_button_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Button_Data *_pd EINA_UNUSED) -{ - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - Evas_Coord minw = -1, minh = -1; - - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - evas_object_size_hint_min_set(obj, minw, minh); -} - EOLIAN static Eina_Bool _efl_ui_button_efl_ui_widget_on_access_activate(Eo *obj, Efl_Ui_Button_Data *_pd EINA_UNUSED, Efl_Ui_Activate act) { @@ -390,7 +378,6 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX) #define EFL_UI_BUTTON_EXTRA_OPS \ ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_button), \ EFL_CANVAS_GROUP_ADD_OPS(efl_ui_button) #include "efl_ui_button.eo.c" diff --git a/src/lib/elementary/efl_ui_calendar.c b/src/lib/elementary/efl_ui_calendar.c index d905324c82..8c21646ba9 100644 --- a/src/lib/elementary/efl_ui_calendar.c +++ b/src/lib/elementary/efl_ui_calendar.c @@ -70,22 +70,6 @@ static int _days_in_month[2][12] = static Eina_Bool _efl_ui_calendar_smart_focus_next_enable = EINA_FALSE; -EOLIAN static void -_efl_ui_calendar_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Calendar_Data *_pd EINA_UNUSED) -{ - Evas_Coord minw = -1, minh = -1; - EFL_UI_CALENDAR_DATA_GET(obj, sd); - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - if (sd->filling) return; - // 7x8 (1 month+year, days, 6 dates.) - elm_coords_finger_size_adjust(7, &minw, 8, &minh); - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); -} - // Get the max day number for each month static inline int _maxdays_get(struct tm *date, int month_offset) @@ -807,12 +791,11 @@ _efl_ui_calendar_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Calendar_Da EOLIAN static void _efl_ui_calendar_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Calendar_Data *_pd EINA_UNUSED) { - elm_layout_freeze(obj); - + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); _set_headers(obj); _populate(obj); - elm_layout_thaw(obj); + efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); } EOLIAN static void @@ -944,6 +927,8 @@ _efl_ui_calendar_efl_object_constructor(Eo *obj, Efl_Ui_Calendar_Data *sd) efl_access_object_role_set(obj, EFL_ACCESS_ROLE_DATE_EDITOR); obj = _efl_ui_calendar_constructor_internal(obj, sd); + // 7x8 (1 month+year, days, 6 dates.) + efl_ui_layout_finger_size_multiplier_set(obj, 7, 8); return obj; } @@ -1168,11 +1153,6 @@ _efl_ui_calendar_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNU ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_calendar, Efl_Ui_Calendar_Data) -/* Internal EO APIs and hidden overrides */ - -#define EFL_UI_CALENDAR_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_calendar) - #include "efl_ui_calendar.eo.c" typedef struct { diff --git a/src/lib/elementary/efl_ui_check.c b/src/lib/elementary/efl_ui_check.c index 4d6ab65cb1..3492c360ee 100644 --- a/src/lib/elementary/efl_ui_check.c +++ b/src/lib/elementary/efl_ui_check.c @@ -129,19 +129,6 @@ _efl_ui_check_efl_ui_widget_on_access_activate(Eo *obj EINA_UNUSED, Efl_Ui_Check return EINA_TRUE; } -EOLIAN static void -_efl_ui_check_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Check_Data *_pd EINA_UNUSED) -{ - Evas_Coord minw = -1, minh = -1; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); -} - static Eina_Bool _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED) { @@ -407,8 +394,7 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX) #define EFL_UI_CHECK_EXTRA_OPS \ ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \ - ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX), \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_check) + ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX) #include "efl_ui_check.eo.c" diff --git a/src/lib/elementary/efl_ui_clock.c b/src/lib/elementary/efl_ui_clock.c index efc62225f7..02dd9b82c6 100644 --- a/src/lib/elementary/efl_ui_clock.c +++ b/src/lib/elementary/efl_ui_clock.c @@ -405,6 +405,7 @@ _reload_format(Evas_Object *obj) if (field->fmt_exist && field->visible) sd->enabled_field_count++; } + efl_ui_layout_finger_size_multiplier_set(obj, sd->enabled_field_count, 1); // assign locations to disabled fields for uniform usage for (idx = 0; idx < EFL_UI_CLOCK_TYPE_COUNT; idx++) @@ -501,21 +502,11 @@ _efl_ui_clock_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Clock_Data *sd } EOLIAN static void -_efl_ui_clock_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Clock_Data *sd) +_efl_ui_clock_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Clock_Data *sd) { - Evas_Coord minw = -1, minh = -1; - - if (sd->freeze_sizing) return; - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - if (sd->enabled_field_count) - elm_coords_finger_size_adjust(sd->enabled_field_count, &minw, 1, &minh); - - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); + /* FIXME: this seems dumb */ + if (!sd->freeze_sizing) + efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); } EOLIAN static Eina_Error @@ -1041,6 +1032,7 @@ _efl_ui_clock_field_visible_set(Eo *obj, Efl_Ui_Clock_Data *sd, Efl_Ui_Clock_Typ evas_object_hide(elm_layout_content_unset(obj, buf)); } sd->freeze_sizing = EINA_FALSE; + efl_ui_layout_finger_size_multiplier_set(obj, sd->enabled_field_count, 1); efl_canvas_group_change(obj); @@ -1165,7 +1157,6 @@ _efl_ui_clock_time_max_set(Eo *obj, Efl_Ui_Clock_Data *sd, Efl_Time maxtime) /* Internal EO APIs and hidden overrides */ #define EFL_UI_CLOCK_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_clock), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_clock) #include "efl_ui_clock.eo.c" diff --git a/src/lib/elementary/efl_ui_clock.eo b/src/lib/elementary/efl_ui_clock.eo index abc7b5e48f..715c494aae 100644 --- a/src/lib/elementary/efl_ui_clock.eo +++ b/src/lib/elementary/efl_ui_clock.eo @@ -223,6 +223,7 @@ class @beta Efl.Ui.Clock extends Efl.Ui.Layout_Base } implements { Efl.Object.constructor; + Efl.Canvas.Group.group_calculate; Efl.Ui.Widget.theme_apply; Efl.Ui.Focus.Object.on_focus_update; Efl.Ui.L10n.translation_update; diff --git a/src/lib/elementary/efl_ui_datepicker.c b/src/lib/elementary/efl_ui_datepicker.c index 666791b36f..a8cf48d344 100644 --- a/src/lib/elementary/efl_ui_datepicker.c +++ b/src/lib/elementary/efl_ui_datepicker.c @@ -222,20 +222,6 @@ _fields_init(Eo *obj) } } -EOLIAN static void -_efl_ui_datepicker_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Datepicker_Data *_pd EINA_UNUSED) -{ - Evas_Coord minw = -1, minh = -1; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); -} - EOLIAN static Eo * _efl_ui_datepicker_efl_object_constructor(Eo *obj, Efl_Ui_Datepicker_Data *pd) { @@ -342,7 +328,4 @@ _efl_ui_datepicker_date_get(const Eo *obj EINA_UNUSED, Efl_Ui_Datepicker_Data *p *day = pd->cur_date[DATEPICKER_DAY]; } -#define EFL_UI_DATEPICKER_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_datepicker), \ - #include "efl_ui_datepicker.eo.c" diff --git a/src/lib/elementary/efl_ui_frame.c b/src/lib/elementary/efl_ui_frame.c index c614ef5508..2ae9a1b53c 100644 --- a/src/lib/elementary/efl_ui_frame.c +++ b/src/lib/elementary/efl_ui_frame.c @@ -95,14 +95,9 @@ _on_frame_clicked(void *data, EOLIAN static void _efl_ui_frame_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Frame_Data *sd) { - EFL_UI_LAYOUT_DATA_GET(obj, ld); - - if (ld->needs_size_calc) - { - /* calling OWN sizing evaluate code here */ - _sizing_eval(obj, sd); - ld->needs_size_calc = EINA_FALSE; - } + /* calling OWN sizing evaluate code here */ + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); + _sizing_eval(obj, sd); } static void diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c index bc64ecb9eb..bdb42cde08 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -373,6 +373,7 @@ _efl_ui_image_zoomable_pan_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Imag Eina_List *l; Evas_Coord ox, oy, ow, oh; + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); ELM_WIDGET_DATA_GET_OR_RETURN(psd->wobj, wd); evas_object_geometry_get(obj, &ox, &oy, &ow, &oh); diff --git a/src/lib/elementary/efl_ui_internal_text_scroller.c b/src/lib/elementary/efl_ui_internal_text_scroller.c index 0773b976b5..cf6f9fbf31 100644 --- a/src/lib/elementary/efl_ui_internal_text_scroller.c +++ b/src/lib/elementary/efl_ui_internal_text_scroller.c @@ -63,13 +63,14 @@ _efl_ui_internal_text_scroller_efl_object_constructor(Eo *obj, } EOLIAN static void -_efl_ui_internal_text_scroller_elm_layout_sizing_eval(Eo *obj, +_efl_ui_internal_text_scroller_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Internal_Text_Scroller_Data *sd) { Eina_Size2D size = {-1, -1}; Eina_Rect view = EINA_RECT(0, 0, 0, 0); Evas_Coord vmw = 0, vmh = 0; + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); EFL_UI_SCROLLER_DATA_GET(obj, psd); ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); @@ -187,7 +188,4 @@ _efl_ui_internal_text_scroller_viewport_clip_get(const Eo *obj, /* Internal EO APIs and hidden overrides */ -#define EFL_UI_INTERNAL_TEXT_SCROLLER_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_internal_text_scroller) - #include "efl_ui_internal_text_scroller.eo.c" diff --git a/src/lib/elementary/efl_ui_internal_text_scroller.eo b/src/lib/elementary/efl_ui_internal_text_scroller.eo index b18c008d76..ea0d573417 100644 --- a/src/lib/elementary/efl_ui_internal_text_scroller.eo +++ b/src/lib/elementary/efl_ui_internal_text_scroller.eo @@ -48,5 +48,6 @@ class @beta Efl.Ui.Internal_Text_Scroller extends Efl.Ui.Scroller Efl.Object.constructor; Efl.Object.finalize; Efl.Object.destructor; + Efl.Canvas.Group.group_calculate; } } diff --git a/src/lib/elementary/efl_ui_item.c b/src/lib/elementary/efl_ui_item.c index 65ecf71cb0..edbfd74937 100644 --- a/src/lib/elementary/efl_ui_item.c +++ b/src/lib/elementary/efl_ui_item.c @@ -202,43 +202,11 @@ EFL_CALLBACKS_ARRAY_DEFINE(self_listening, /* Mouse Controls ends */ -static void -_sizing_eval(Evas_Object *obj, Efl_Ui_Item_Data *pd) -{ - Evas_Coord minh = -1, minw = -1; - Evas_Coord rest_w = 0, rest_h = 0; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh, - rest_w, rest_h); - evas_object_size_hint_min_set(obj, minw, minh); - - pd->needs_size_calc = EINA_FALSE; -} - -static void -_efl_ui_item_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Item_Data *pd) -{ - if (pd->needs_size_calc) return; - pd->needs_size_calc = EINA_TRUE; - - efl_canvas_group_change(obj); -} - -EOLIAN static void -_efl_ui_item_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Item_Data *pd) -{ - if (pd->needs_size_calc) - { - _sizing_eval(obj, pd); - pd->needs_size_calc = EINA_FALSE; - } -} - EOLIAN static Eo * _efl_ui_item_efl_object_constructor(Eo *obj, Efl_Ui_Item_Data *pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); + efl_ui_layout_finger_size_multiplier_set(obj, 0, 0); efl_event_callback_array_add(obj, self_listening(), obj); @@ -302,9 +270,4 @@ _efl_ui_item_container_get(const Eo *obj EINA_UNUSED, Efl_Ui_Item_Data *pd) return pd->parent; } -/* Internal EO APIs and hidden overrides */ - -#define EFL_UI_ITEM_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_item) - #include "efl_ui_item.eo.c" diff --git a/src/lib/elementary/efl_ui_item.eo b/src/lib/elementary/efl_ui_item.eo index aa760046f1..a2a7ad71fd 100644 --- a/src/lib/elementary/efl_ui_item.eo +++ b/src/lib/elementary/efl_ui_item.eo @@ -55,6 +55,5 @@ abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Selectab Efl.Object.constructor; Efl.Object.finalize; Efl.Object.destructor; - Efl.Canvas.Group.group_calculate; } } diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index 80b97abf63..cde03e3213 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -206,7 +206,7 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd) elm_coords_finger_size_adjust(sd->finger_size_multiplier_x, NULL, sd->finger_size_multiplier_y, &minh); evas_object_size_hint_min_set(obj, minw, minh); - + efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); sd->restricted_calc_w = sd->restricted_calc_h = EINA_FALSE; } @@ -529,6 +529,11 @@ _efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd) (theme_apply_internal_ret == EFL_UI_THEME_APPLY_ERROR_DEFAULT)) return EFL_UI_THEME_APPLY_ERROR_DEFAULT; + /* unset existing size hints to force accurate recalc */ + efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(0, 0)); + if (elm_widget_is_legacy(obj)) + efl_gfx_hint_size_min_set(obj, EINA_SIZE2D(0, 0)); + return EFL_UI_THEME_APPLY_ERROR_NONE; } @@ -2531,6 +2536,7 @@ _efl_ui_layout_base_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNU ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); eo = efl_finalize(efl_super(obj, MY_CLASS)); efl_ui_widget_theme_apply(eo); + efl_canvas_group_change(obj); win = elm_widget_top_get(obj); if (efl_isa(win, EFL_UI_WIN_CLASS)) diff --git a/src/lib/elementary/efl_ui_list_view.c b/src/lib/elementary/efl_ui_list_view.c index 12bf65ad4c..0a686e740a 100644 --- a/src/lib/elementary/efl_ui_list_view.c +++ b/src/lib/elementary/efl_ui_list_view.c @@ -46,6 +46,7 @@ static const Elm_Action key_actions[] = { EOLIAN static void _efl_ui_list_view_pan_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Efl_Ui_List_View_Pan_Data *psd) { + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); evas_object_smart_changed(psd->wobj); } diff --git a/src/lib/elementary/efl_ui_pan.c b/src/lib/elementary/efl_ui_pan.c index 3412cba005..753793606d 100644 --- a/src/lib/elementary/efl_ui_pan.c +++ b/src/lib/elementary/efl_ui_pan.c @@ -213,6 +213,7 @@ _efl_ui_pan_efl_content_content_unset(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *pd) EOLIAN static void _efl_ui_pan_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *psd) { + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); efl_gfx_entity_position_set(psd->content, EINA_POSITION2D(psd->x - psd->px, psd->y - psd->py)); } #include "efl_ui_pan.eo.c" diff --git a/src/lib/elementary/efl_ui_panel.c b/src/lib/elementary/efl_ui_panel.c index eba318d102..cad4a8f807 100644 --- a/src/lib/elementary/efl_ui_panel.c +++ b/src/lib/elementary/efl_ui_panel.c @@ -53,10 +53,8 @@ _mirrored_set(Evas_Object *obj, } EOLIAN static void -_efl_ui_panel_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Panel_Data *sd) +_efl_ui_panel_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Panel_Data *sd) { - Evas_Coord mw = 0, mh = 0; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); if (sd->delete_me) return; @@ -67,10 +65,7 @@ _efl_ui_panel_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Panel_Data *sd) else _drawer_open(obj, wd->w, wd->h, EINA_FALSE); } - evas_object_smart_calculate(sd->bx); - edje_object_size_min_calc(wd->resize_obj, &mw, &mh); - evas_object_size_hint_min_set(obj, mw, mh); - evas_object_size_hint_max_set(obj, -1, -1); + efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); } static char * @@ -863,6 +858,9 @@ _efl_ui_panel_efl_object_constructor(Eo *obj, Efl_Ui_Panel_Data *_pd) else { elm_layout_content_set(obj, "efl.content", _pd->bx); + /* trigger box recalc on manual panel calc */ + _efl_ui_layout_subobjs_calc_set(obj, EINA_TRUE); + efl_ui_layout_finger_size_multiplier_set(obj, 0, 0); if (edje_object_part_exists (wd->resize_obj, "efl.swallow.event")) @@ -1404,7 +1402,4 @@ _efl_ui_panel_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED /* Internal EO APIs and hidden overrides */ -#define EFL_UI_PANEL_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_panel) - #include "efl_ui_panel.eo.c" diff --git a/src/lib/elementary/efl_ui_panel.eo b/src/lib/elementary/efl_ui_panel.eo index fffe726ccb..39b3100636 100644 --- a/src/lib/elementary/efl_ui_panel.eo +++ b/src/lib/elementary/efl_ui_panel.eo @@ -79,6 +79,7 @@ class @beta Efl.Ui.Panel extends Efl.Ui.Layout_Base implements Efl.Ui.Focus.Laye Efl.Gfx.Entity.position { set; } Efl.Gfx.Entity.size { set; } Efl.Canvas.Group.group_member_add; + Efl.Canvas.Group.group_calculate; Efl.Ui.Widget.theme_apply; Efl.Ui.Widget.disabled {set;} Efl.Ui.Widget.on_access_update; diff --git a/src/lib/elementary/efl_ui_panes.c b/src/lib/elementary/efl_ui_panes.c index 9d44173cc9..d818ec0fcc 100644 --- a/src/lib/elementary/efl_ui_panes.c +++ b/src/lib/elementary/efl_ui_panes.c @@ -202,13 +202,14 @@ _on_unpressed(void *data, } EOLIAN static void -_efl_ui_panes_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Panes_Data *sd) +_efl_ui_panes_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Panes_Data *sd) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); Eo *first_content, *second_content; Eina_Size2D min; + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); if (elm_widget_is_legacy(obj)) { first_content = efl_content_get(efl_part(obj, "elm.swallow.left")); @@ -698,8 +699,7 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_panes) #define EFL_UI_PANES_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_OPS(efl_ui_panes), \ - ELM_LAYOUT_CONTENT_ALIASES_OPS(efl_ui_panes), \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_panes) + ELM_LAYOUT_CONTENT_ALIASES_OPS(efl_ui_panes) #include "efl_ui_panes.eo.c" #include "efl_ui_panes_eo.legacy.c" diff --git a/src/lib/elementary/efl_ui_panes.eo b/src/lib/elementary/efl_ui_panes.eo index 5b5029a67f..0194fe0ec1 100644 --- a/src/lib/elementary/efl_ui_panes.eo +++ b/src/lib/elementary/efl_ui_panes.eo @@ -47,6 +47,7 @@ class @beta Efl.Ui.Panes extends Efl.Ui.Layout_Base implements Efl.Ui.Layout_Ori } implements { Efl.Object.constructor; + Efl.Canvas.Group.group_calculate; Efl.Ui.Widget.theme_apply; Efl.Ui.Layout_Orientable.orientation { get; set; [[Only supports $vertical and $horizontal. Default is $vertical.]] } Efl.Part.part_get; diff --git a/src/lib/elementary/efl_ui_popup.c b/src/lib/elementary/efl_ui_popup.c index 214758db9c..007e5f5b9b 100644 --- a/src/lib/elementary/efl_ui_popup.c +++ b/src/lib/elementary/efl_ui_popup.c @@ -89,11 +89,7 @@ _parent_geom_cb(void *data, const Efl_Event *ev EINA_UNUSED) EFL_UI_POPUP_DATA_GET_OR_RETURN(obj, pd); - //Add align calc only - Eina_Bool needs_size_calc = pd->needs_size_calc; efl_canvas_group_change(obj); - efl_canvas_group_calculate(obj); - pd->needs_size_calc = needs_size_calc; } EOLIAN static void @@ -132,11 +128,7 @@ _efl_ui_popup_align_set(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd, Efl_Ui_Popup { pd->align = type; - //Add align calc only - Eina_Bool needs_size_calc = pd->needs_size_calc; efl_canvas_group_change(obj); - efl_canvas_group_calculate(obj); - pd->needs_size_calc = needs_size_calc; } EOLIAN static Efl_Ui_Popup_Align @@ -265,40 +257,19 @@ _efl_ui_popup_efl_object_destructor(Eo *obj, Efl_Ui_Popup_Data *pd) static void _sizing_eval(Eo *obj) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - Evas_Coord minw = -1, minh = -1; + Eina_Size2D min; - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - efl_gfx_hint_size_min_set(obj, EINA_SIZE2D(minw, minh)); + /* trigger layout calc */ + efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); + min = efl_gfx_hint_size_restricted_min_get(obj); Eina_Size2D size = efl_gfx_entity_size_get(obj); Eina_Size2D new_size; - new_size.w = (minw > size.w ? minw : size.w); - new_size.h = (minh > size.h ? minh : size.h); + new_size.w = (min.w > size.w ? min.w : size.w); + new_size.h = (min.h > size.h ? min.h : size.h); efl_gfx_entity_size_set(obj, new_size); -} - -EOLIAN static void -_efl_ui_popup_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Popup_Data *pd) -{ - if (pd->needs_group_calc) return; - pd->needs_group_calc = EINA_TRUE; - - /* These flags can be modified by sub classes not to calculate size or align - * their super classes. - * e.g. Efl.Ui.Popup.Alert.Scroll class sets the flag as follows not to - * calculate size by its super class. - * - * ppd->needs_size_calc = EINA_FALSE; - * efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); - */ - pd->needs_size_calc = EINA_TRUE; - pd->needs_align_calc = EINA_TRUE; - - evas_object_smart_changed(obj); + efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); } EOLIAN static void @@ -308,26 +279,14 @@ _efl_ui_popup_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Popup_Data *pd) * calculation. * The actual size calculation is done here when the object is rendered to * avoid duplicate size calculations. */ - if (pd->needs_group_calc) - { - if (pd->needs_size_calc) - { - _sizing_eval(obj); - pd->needs_size_calc = EINA_FALSE; - } - if (pd->needs_align_calc) - { - _calc_align(obj); - pd->needs_align_calc = EINA_FALSE; - } + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); + _sizing_eval(obj); + _calc_align(obj); - Eina_Rect p_geom = efl_gfx_entity_geometry_get(pd->win_parent); + Eina_Rect p_geom = efl_gfx_entity_geometry_get(pd->win_parent); - efl_gfx_entity_position_set(pd->backwall, EINA_POSITION2D(0, 0)); - efl_gfx_entity_size_set(pd->backwall, EINA_SIZE2D(p_geom.w, p_geom.h)); - - pd->needs_group_calc = EINA_FALSE; - } + efl_gfx_entity_position_set(pd->backwall, EINA_POSITION2D(0, 0)); + efl_gfx_entity_size_set(pd->backwall, EINA_SIZE2D(p_geom.w, p_geom.h)); } /* Standard widget overrides */ @@ -424,9 +383,4 @@ _efl_ui_popup_part_backwall_efl_file_load(Eo *obj, void *_pd EINA_UNUSED) /* Efl.Part end */ -/* Internal EO APIs and hidden overrides */ - -#define EFL_UI_POPUP_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_popup) - #include "efl_ui_popup.eo.c" diff --git a/src/lib/elementary/efl_ui_popup_private.h b/src/lib/elementary/efl_ui_popup_private.h index 3cf0eee24a..77b989af75 100644 --- a/src/lib/elementary/efl_ui_popup_private.h +++ b/src/lib/elementary/efl_ui_popup_private.h @@ -9,9 +9,6 @@ struct _Efl_Ui_Popup_Data Efl_Ui_Popup_Align align; Ecore_Timer *timer; double timeout; - Eina_Bool needs_group_calc : 1; - Eina_Bool needs_size_calc : 1; - Eina_Bool needs_align_calc : 1; }; #define EFL_UI_POPUP_DATA_GET_OR_RETURN(o, ptr, ...) \ diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c index 00de86bbba..e206138d99 100644 --- a/src/lib/elementary/efl_ui_progressbar.c +++ b/src/lib/elementary/efl_ui_progressbar.c @@ -134,18 +134,6 @@ _val_set(Evas_Object *obj) } } -EOLIAN static void -_efl_ui_progressbar_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Progressbar_Data *_pd EINA_UNUSED) -{ - Evas_Coord minw = -1, minh = -1; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); -} - //TODO: efl_ui_slider also use this. static const char * _theme_group_modify_pos_get(const char *cur_group, const char *search, size_t len, Eina_Bool is_legacy) @@ -348,6 +336,8 @@ _efl_ui_progressbar_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Progressbar_Data elm_widget_theme_klass_set(obj, "progressbar"); efl_canvas_group_add(efl_super(obj, MY_CLASS)); + efl_ui_layout_finger_size_multiplier_set(obj, 0, 0); + priv->dir = EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL; priv->val = MIN_RATIO_LVL; priv->val_max = 1.0; @@ -785,7 +775,6 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_progressbar) #define EFL_UI_PROGRESSBAR_EXTRA_OPS \ ELM_LAYOUT_CONTENT_ALIASES_OPS(efl_ui_progressbar), \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_progressbar), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_progressbar) #include "efl_ui_progressbar.eo.c" diff --git a/src/lib/elementary/efl_ui_relative_layout.c b/src/lib/elementary/efl_ui_relative_layout.c index 7e8b6f3c01..983a507e71 100644 --- a/src/lib/elementary/efl_ui_relative_layout.c +++ b/src/lib/elementary/efl_ui_relative_layout.c @@ -565,6 +565,7 @@ _efl_ui_relative_layout_efl_pack_layout_layout_request(Eo *obj, Efl_Ui_Relative_ EOLIAN static void _efl_ui_relative_layout_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Relative_Layout_Data *pd EINA_UNUSED) { + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); efl_pack_layout_update(obj); } diff --git a/src/lib/elementary/efl_ui_scroll_alert_popup.c b/src/lib/elementary/efl_ui_scroll_alert_popup.c index 9836f8dfcb..476178d9ae 100644 --- a/src/lib/elementary/efl_ui_scroll_alert_popup.c +++ b/src/lib/elementary/efl_ui_scroll_alert_popup.c @@ -98,6 +98,7 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Scroll_Alert_Popup_Data *pd, elm_scroller_content_min_limit(pd->scroller, min_limit_w, min_limit_h); efl_gfx_entity_size_set(obj, new_size); } + efl_canvas_group_calculate(pd->scroller); efl_gfx_hint_size_min_set(obj, new_min); } @@ -112,6 +113,7 @@ _sizing_eval(Eo *obj, Efl_Ui_Scroll_Alert_Popup_Data *pd) //Calculate popup's min size including scroller's min size { elm_scroller_content_min_limit(pd->scroller, EINA_TRUE, EINA_TRUE); + efl_canvas_group_calculate(pd->scroller); elm_coords_finger_size_adjust(1, &scr_minw, 1, &scr_minh); edje_object_size_min_restricted_calc @@ -121,6 +123,7 @@ _sizing_eval(Eo *obj, Efl_Ui_Scroll_Alert_Popup_Data *pd) //Calculate popup's min size except scroller's min size { elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE); + efl_canvas_group_calculate(pd->scroller); elm_coords_finger_size_adjust(1, &obj_minw, 1, &obj_minh); edje_object_size_min_restricted_calc @@ -137,17 +140,12 @@ _efl_ui_scroll_alert_popup_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Scro * calculation. * The actual size calculation is done here when the object is rendered to * avoid duplicate size calculations. */ - EFL_UI_POPUP_DATA_GET_OR_RETURN(obj, ppd); + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); - if (ppd->needs_group_calc) - { - if (ppd->needs_size_calc) - _sizing_eval(obj, pd); + _sizing_eval(obj, pd); - //Not to calculate size by super class - ppd->needs_size_calc = EINA_FALSE; - efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); - } + //Not to calculate size by super class + efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); } static Eina_Bool diff --git a/src/lib/elementary/efl_ui_scroller.c b/src/lib/elementary/efl_ui_scroller.c index b15e04e41b..fdd6139c19 100644 --- a/src/lib/elementary/efl_ui_scroller.c +++ b/src/lib/elementary/efl_ui_scroller.c @@ -289,13 +289,14 @@ _efl_ui_scroller_efl_object_destructor(Eo *obj, } EOLIAN static void -_efl_ui_scroller_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Scroller_Data *sd) +_efl_ui_scroller_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Scroller_Data *sd) { Eina_Size2D min = {0, 0}, max = {0, 0}, size = {-1, -1}; Eina_Rect view = {}; Evas_Coord vmw = 0, vmh = 0; double xw = 0.0, yw = 0.0; + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); if (sd->content) @@ -392,7 +393,4 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_scroller, Efl_Ui_Scroller_Data) /* Internal EO APIs and hidden overrides */ -#define EFL_UI_SCROLLER_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_scroller) - #include "efl_ui_scroller.eo.c" diff --git a/src/lib/elementary/efl_ui_scroller.eo b/src/lib/elementary/efl_ui_scroller.eo index 8f90d23462..36f42c16b0 100644 --- a/src/lib/elementary/efl_ui_scroller.eo +++ b/src/lib/elementary/efl_ui_scroller.eo @@ -12,6 +12,7 @@ class @beta Efl.Ui.Scroller extends Efl.Ui.Layout_Base implements Efl.Object.destructor; Efl.Content.content { get; set; } Efl.Content.content_unset; + Efl.Canvas.Group.group_calculate; Efl.Ui.Widget.theme_apply; Efl.Ui.Widget.focus_state_apply; Efl.Ui.Widget.widget_input_event_handler; diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c index 2714cce3d5..4bcf1d8df3 100644 --- a/src/lib/elementary/efl_ui_slider.c +++ b/src/lib/elementary/efl_ui_slider.c @@ -456,19 +456,6 @@ _efl_ui_slider_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Slider_Data *sd) return int_ret; } -EOLIAN static void -_efl_ui_slider_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Slider_Data *_pd EINA_UNUSED) -{ - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - Evas_Coord minw = -1, minh = -1; - - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); - efl_gfx_hint_size_max_set(obj, EINA_SIZE2D(-1, -1)); -} - static void _spacer_down_cb(void *data, Evas *e EINA_UNUSED, @@ -880,7 +867,6 @@ EFL_VOID_FUNC_BODYV(efl_ui_slider_down_knob, EFL_FUNC_CALL(button_x, button_y), EFL_VOID_FUNC_BODYV(efl_ui_slider_move_knob, EFL_FUNC_CALL(button_x, button_y), double button_x, double button_y) #define EFL_UI_SLIDER_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_slider), \ EFL_UI_SLIDER_VAL_FETCH_OPS(efl_ui_slider), \ EFL_UI_SLIDER_VAL_SET_OPS(efl_ui_slider), \ EFL_UI_SLIDER_DOWN_KNOB_OPS(efl_ui_slider), \ diff --git a/src/lib/elementary/efl_ui_spin.c b/src/lib/elementary/efl_ui_spin.c index bbfeba78ef..636e3fec5f 100644 --- a/src/lib/elementary/efl_ui_spin.c +++ b/src/lib/elementary/efl_ui_spin.c @@ -29,20 +29,6 @@ _label_write(Evas_Object *obj, Efl_Ui_Spin_Data *sd) eina_strbuf_free(strbuf); } -EOLIAN static void -_efl_ui_spin_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Spin_Data *_pd EINA_UNUSED) -{ - Evas_Coord minw = -1, minh = -1; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); -} - EOLIAN static Eina_Bool _efl_ui_spin_efl_ui_widget_widget_input_event_handler(Eo *obj, Efl_Ui_Spin_Data *sd, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED) { @@ -185,7 +171,4 @@ _efl_ui_spin_efl_ui_range_display_range_value_get(const Eo *obj EINA_UNUSED, Efl return sd->val; } -#define EFL_UI_SPIN_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_spin), \ - #include "efl_ui_spin.eo.c" diff --git a/src/lib/elementary/efl_ui_table.c b/src/lib/elementary/efl_ui_table.c index 6655573231..f2d90be60d 100644 --- a/src/lib/elementary/efl_ui_table.c +++ b/src/lib/elementary/efl_ui_table.c @@ -167,6 +167,7 @@ _efl_ui_table_efl_pack_layout_layout_update(Eo *obj, Efl_Ui_Table_Data *pd) EOLIAN void _efl_ui_table_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Table_Data *_pd EINA_UNUSED) { + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); efl_pack_layout_update(obj); } diff --git a/src/lib/elementary/efl_ui_tags.c b/src/lib/elementary/efl_ui_tags.c index 449681462c..07f6ac02bc 100644 --- a/src/lib/elementary/efl_ui_tags.c +++ b/src/lib/elementary/efl_ui_tags.c @@ -464,21 +464,6 @@ _efl_ui_tags_efl_ui_widget_widget_input_event_handler(Eo *obj EINA_UNUSED, Efl_U return EINA_FALSE; } -EOLIAN static void -_efl_ui_tags_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Tags_Data *sd EINA_UNUSED) -{ - Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - efl_gfx_hint_size_min_set(obj, EINA_SIZE2D(minw, minh)); - efl_gfx_hint_size_max_set(obj, EINA_SIZE2D(maxw, maxh)); -} - static void _mouse_clicked_signal_cb(void *data EINA_UNUSED, Evas_Object *obj, @@ -1142,7 +1127,4 @@ _efl_ui_tags_efl_ui_format_apply_formatted_value(Eo *obj EINA_UNUSED, Efl_Ui_Tag _view_update(pd); } -#define EFL_UI_TAGS_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_tags), \ - #include "efl_ui_tags.eo.c" diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index b76c69e93b..f9a575f87a 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -856,11 +856,13 @@ _cursor_geometry_recalc(Evas_Object *obj) #define SIZE2D_EQ(X, Y) (((X).w == (Y).w) && ((X).h == (Y).h)) EOLIAN static void -_efl_ui_text_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Text_Data *sd) +_efl_ui_text_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Text_Data *sd) { Eina_Size2D min = EINA_SIZE2D(0, 0); Eina_Size2D edmin = EINA_SIZE2D(0, 0); Eina_Size2D sz = EINA_SIZE2D(0, 0); + + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); sz = efl_gfx_entity_size_get(obj); @@ -4074,9 +4076,6 @@ ELM_PART_OVERRIDE_TEXT_GET(efl_ui_text, EFL_UI_TEXT, Efl_Ui_Text_Data) //ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX) -#define EFL_UI_TEXT_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_text) - #include "efl_ui_text.eo.c" EOLIAN static Eo * diff --git a/src/lib/elementary/efl_ui_text.eo b/src/lib/elementary/efl_ui_text.eo index a0a1807942..b52a3923a4 100644 --- a/src/lib/elementary/efl_ui_text.eo +++ b/src/lib/elementary/efl_ui_text.eo @@ -314,6 +314,7 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl Efl.Gfx.Entity.position { set; } Efl.Gfx.Entity.size { set; } Efl.Canvas.Group.group_member_add; + Efl.Canvas.Group.group_calculate; Efl.Layout.Signal.signal_callback_add; Efl.Layout.Signal.signal_callback_del; Efl.Layout.Signal.signal_emit; diff --git a/src/lib/elementary/efl_ui_text_alert_popup.c b/src/lib/elementary/efl_ui_text_alert_popup.c index c6c01a03f4..2f014e0a11 100644 --- a/src/lib/elementary/efl_ui_text_alert_popup.c +++ b/src/lib/elementary/efl_ui_text_alert_popup.c @@ -102,6 +102,7 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd, Eina_Size2D obj elm_scroller_content_min_limit(pd->scroller, min_limit_w, min_limit_h); efl_gfx_entity_size_set(obj, new_size); } + efl_canvas_group_calculate(pd->scroller); efl_gfx_hint_size_min_set(obj, new_min); } @@ -127,10 +128,13 @@ _sizing_eval(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd) //Calculate popup's min size including scroller's min size { elm_label_line_wrap_set(pd->message, ELM_WRAP_NONE); + efl_canvas_group_calculate(pd->message); text_min = efl_gfx_hint_size_combined_min_get(pd->message); elm_label_line_wrap_set(pd->message, ELM_WRAP_MIXED); + efl_canvas_group_calculate(pd->message); elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_TRUE); + efl_canvas_group_calculate(pd->scroller); elm_coords_finger_size_adjust(1, &text_minw, 1, &text_minh); edje_object_size_min_restricted_calc @@ -140,6 +144,7 @@ _sizing_eval(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd) //Calculate popup's min size except scroller's min size { elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE); + efl_canvas_group_calculate(pd->scroller); elm_coords_finger_size_adjust(1, &obj_minw, 1, &obj_minh); edje_object_size_min_restricted_calc @@ -157,17 +162,11 @@ _efl_ui_text_alert_popup_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Text_A * calculation. * The actual size calculation is done here when the object is rendered to * avoid duplicate size calculations. */ - EFL_UI_POPUP_DATA_GET_OR_RETURN(obj, ppd); + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); - if (ppd->needs_group_calc) - { - if (ppd->needs_size_calc) - _sizing_eval(obj, pd); + _sizing_eval(obj, pd); - //Not to calculate size by super class - ppd->needs_size_calc = EINA_FALSE; - efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); - } + efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); } static Eina_Bool diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c index ee16a2f4df..c06cbf62d1 100644 --- a/src/lib/elementary/efl_ui_textpath.c +++ b/src/lib/elementary/efl_ui_textpath.c @@ -666,8 +666,9 @@ _textpath_text_set_internal(Eo *obj, Efl_Ui_Textpath_Data *pd, const char *part, } EOLIAN static void -_efl_ui_textpath_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd) +_efl_ui_textpath_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Textpath_Data *pd) { + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); _sizing_eval(pd); } diff --git a/src/lib/elementary/efl_ui_timepicker.c b/src/lib/elementary/efl_ui_timepicker.c index 6d568bcef8..d7dd01a1fb 100644 --- a/src/lib/elementary/efl_ui_timepicker.c +++ b/src/lib/elementary/efl_ui_timepicker.c @@ -195,20 +195,6 @@ _fields_init(Eo *obj) } } -EOLIAN static void -_efl_ui_timepicker_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Timepicker_Data *_pd EINA_UNUSED) -{ - Evas_Coord minw = -1, minh = -1; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); -} - EOLIAN static Eo * _efl_ui_timepicker_efl_object_constructor(Eo *obj, Efl_Ui_Timepicker_Data *pd EINA_UNUSED) { @@ -277,7 +263,4 @@ _efl_ui_timepicker_ampm_get(const Eo *obj EINA_UNUSED, Efl_Ui_Timepicker_Data *p return pd->is_24hour; } -#define EFL_UI_TIMEPICKER_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_timepicker), \ - #include "efl_ui_timepicker.eo.c" diff --git a/src/lib/elementary/efl_ui_video.c b/src/lib/elementary/efl_ui_video.c index fe26077fd4..a80ce0ad1e 100644 --- a/src/lib/elementary/efl_ui_video.c +++ b/src/lib/elementary/efl_ui_video.c @@ -107,13 +107,14 @@ _key_action_play(Evas_Object *obj, const char *params EINA_UNUSED) } EOLIAN static void -_efl_ui_video_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Video_Data *sd) +_efl_ui_video_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Video_Data *sd) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); Evas_Coord minw = 0, minh = 0; Evas_Coord w = 0, h = 0; + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); evas_object_size_hint_request_get(sd->emotion, &minw, &minh); if (minw && minh) evas_object_size_hint_aspect_set @@ -416,7 +417,6 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_video, Efl_Ui_Video_Data) /* Internal EO APIs and hidden overrides */ #define EFL_UI_VIDEO_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_video), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_video) #include "efl_ui_video.eo.c" diff --git a/src/lib/elementary/efl_ui_video.eo b/src/lib/elementary/efl_ui_video.eo index ab9c3ce48d..9ecdc35db2 100644 --- a/src/lib/elementary/efl_ui_video.eo +++ b/src/lib/elementary/efl_ui_video.eo @@ -42,6 +42,7 @@ class @beta Efl.Ui.Video extends Efl.Ui.Layout_Base implements Efl.File, Efl.Pla implements { Efl.Object.constructor; Efl.File.load; + Efl.Canvas.Group.group_calculate; Efl.Ui.Widget.widget_input_event_handler; Efl.Access.Widget.Action.elm_actions { get; } Efl.Player.start; diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index 43fe92bd86..e99465b856 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -961,6 +961,7 @@ EOLIAN static void _efl_ui_widget_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED) { /* a NO-OP, on the base */ + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); } EOLIAN static void diff --git a/src/lib/elementary/elc_ctxpopup.c b/src/lib/elementary/elc_ctxpopup.c index fadf7af26a..c391573c0c 100644 --- a/src/lib/elementary/elc_ctxpopup.c +++ b/src/lib/elementary/elc_ctxpopup.c @@ -532,7 +532,7 @@ _elm_ctxpopup_efl_ui_widget_widget_sub_object_add(Eo *obj, Elm_Ctxpopup_Data *_p } EOLIAN static void -_elm_ctxpopup_elm_layout_sizing_eval(Eo *obj, Elm_Ctxpopup_Data *sd) +_elm_ctxpopup_efl_canvas_group_calculate(Eo *obj, Elm_Ctxpopup_Data *sd) { Eina_Rectangle rect = { 0, 0, 1, 1 }; Evas_Coord_Point list_size = { 0, 0 }, parent_size = {0, 0}; @@ -1552,7 +1552,7 @@ ELM_PART_OVERRIDE_CONTENT_UNSET(elm_ctxpopup, ELM_CTXPOPUP, Elm_Ctxpopup_Data) /* Internal EO APIs and hidden overrides */ #define ELM_CTXPOPUP_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_ctxpopup), \ + EFL_CANVAS_GROUP_CALC_OPS(elm_ctxpopup), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_ctxpopup) #include "elm_ctxpopup_item_eo.c" diff --git a/src/lib/elementary/elc_fileselector_entry.c b/src/lib/elementary/elc_fileselector_entry.c index bf9b7067ab..13243b5d6d 100644 --- a/src/lib/elementary/elc_fileselector_entry.c +++ b/src/lib/elementary/elc_fileselector_entry.c @@ -120,18 +120,6 @@ _ACTIVATED_fwd(void *data, const Efl_Event *event) (data, ELM_FILESELECTOR_ENTRY_EVENT_ACTIVATED, event->info); } -EOLIAN static void -_elm_fileselector_entry_elm_layout_sizing_eval(Eo *obj, Elm_Fileselector_Entry_Data *sd EINA_UNUSED) -{ - Evas_Coord minw = -1, minh = -1; - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - edje_object_size_min_calc(wd->resize_obj, &minw, &minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); -} - EOLIAN static Eina_Error _elm_fileselector_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_Entry_Data *sd) { @@ -233,6 +221,7 @@ _elm_fileselector_entry_efl_canvas_group_group_add(Eo *obj, Elm_Fileselector_Ent efl_ui_mirrored_set(priv->button, efl_ui_mirrored_get(obj)); elm_widget_style_set(priv->button, "fileselector_entry/default"); efl_composite_attach(obj, priv->button); + efl_ui_layout_finger_size_multiplier_set(obj, 0, 0); elm_fileselector_expandable_set (priv->button, _elm_config->fileselector_expand_enable); @@ -586,7 +575,6 @@ ELM_PART_CONTENT_DEFAULT_GET(elm_fileselector_entry, "button icon") #define ELM_FILESELECTOR_ENTRY_EXTRA_OPS \ ELM_PART_CONTENT_DEFAULT_OPS(elm_fileselector_entry), \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_fileselector_entry), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_fileselector_entry) #include "elm_fileselector_entry_eo.c" diff --git a/src/lib/elementary/elc_multibuttonentry.c b/src/lib/elementary/elc_multibuttonentry.c index 9bcb64514e..e40eb4f8a5 100644 --- a/src/lib/elementary/elc_multibuttonentry.c +++ b/src/lib/elementary/elc_multibuttonentry.c @@ -947,21 +947,6 @@ _elm_multibuttonentry_efl_ui_widget_widget_input_event_handler(Eo *obj EINA_UNUS return EINA_FALSE; } -EOLIAN static void -_elm_multibuttonentry_elm_layout_sizing_eval(Eo *obj, Elm_Multibuttonentry_Data *sd EINA_UNUSED) -{ - Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, maxw, maxh); -} - static void _mouse_clicked_signal_cb(void *data EINA_UNUSED, Evas_Object *obj, @@ -2029,7 +2014,6 @@ ELM_PART_OVERRIDE_TEXT_GET(elm_multibuttonentry, ELM_MULTIBUTTONENTRY, Elm_Multi /* Internal EO APIs and hidden overrides */ #define ELM_MULTIBUTTONENTRY_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_multibuttonentry), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_multibuttonentry) #include "elm_multibuttonentry_item_eo.c" diff --git a/src/lib/elementary/elc_naviframe.c b/src/lib/elementary/elc_naviframe.c index 862edec01c..b14f67932d 100644 --- a/src/lib/elementary/elc_naviframe.c +++ b/src/lib/elementary/elc_naviframe.c @@ -908,7 +908,7 @@ _elm_naviframe_item_elm_widget_item_signal_emit(Eo *eo_it EINA_UNUSED, } EOLIAN static void -_elm_naviframe_elm_layout_sizing_eval(Eo *obj, Elm_Naviframe_Data *sd) +_elm_naviframe_efl_canvas_group_calculate(Eo *obj, Elm_Naviframe_Data *sd) { Evas_Coord minw = 0, minh = 0; Elm_Naviframe_Item_Data *it, *top; @@ -2047,7 +2047,7 @@ ELM_PART_OVERRIDE_TEXT_GET(elm_naviframe, ELM_NAVIFRAME, Elm_Naviframe_Data) /* Internal EO APIs and hidden overrides */ #define ELM_NAVIFRAME_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_naviframe), \ + EFL_CANVAS_GROUP_CALC_OPS(elm_naviframe), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_naviframe) #include "elm_naviframe_item_eo.c" diff --git a/src/lib/elementary/elc_player.c b/src/lib/elementary/elc_player.c index 8c104d4fa6..c5a17e0b78 100644 --- a/src/lib/elementary/elc_player.c +++ b/src/lib/elementary/elc_player.c @@ -211,18 +211,6 @@ _elm_player_efl_ui_widget_theme_apply(Eo *obj, Elm_Player_Data *sd) return int_ret; } -EOLIAN static void -_elm_player_elm_layout_sizing_eval(Eo *obj, Elm_Player_Data *sd EINA_UNUSED) -{ - Evas_Coord w, h; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - edje_object_size_min_get(wd->resize_obj, &w, &h); - edje_object_size_min_restricted_calc - (wd->resize_obj, &w, &h, w, h); - evas_object_size_hint_min_set(obj, w, h); -} - static void _update_slider(void *data, const Efl_Event *event EINA_UNUSED) { @@ -596,6 +584,7 @@ _elm_player_efl_canvas_group_group_add(Eo *obj, Elm_Player_Data *priv) if (!elm_layout_theme_set(obj, "player", "base", elm_widget_style_get(obj))) CRI("Failed to set layout!"); + efl_ui_layout_finger_size_multiplier_set(obj, 0, 0); priv->forward = _player_button_add(obj, "forward", _forward); priv->info = _player_button_add(obj, "info", _info); priv->next = _player_button_add(obj, "next", _next); @@ -706,7 +695,6 @@ ELM_PART_CONTENT_DEFAULT_GET(elm_player, "video") #define ELM_PLAYER_EXTRA_OPS \ ELM_PART_CONTENT_DEFAULT_OPS(elm_player), \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_player), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_player) #include "elm_player_eo.c" diff --git a/src/lib/elementary/elc_popup.c b/src/lib/elementary/elc_popup.c index 09527b28c2..7e04f6be4d 100644 --- a/src/lib/elementary/elc_popup.c +++ b/src/lib/elementary/elc_popup.c @@ -458,7 +458,7 @@ _item_sizing_eval(Elm_Popup_Item_Data *it) } EOLIAN static void -_elm_popup_elm_layout_sizing_eval(Eo *obj, Elm_Popup_Data *sd) +_elm_popup_efl_canvas_group_calculate(Eo *obj, Elm_Popup_Data *sd) { Eina_List *elist; Elm_Popup_Item_Data *it; @@ -1868,7 +1868,7 @@ ELM_PART_OVERRIDE_TEXT_GET(elm_popup, ELM_POPUP, Elm_Popup_Data) /* Internal EO APIs and hidden overrides */ #define ELM_POPUP_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_popup), \ + EFL_CANVAS_GROUP_CALC_OPS(elm_popup), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_popup) #include "elm_popup_eo.c" diff --git a/src/lib/elementary/elm_actionslider.c b/src/lib/elementary/elm_actionslider.c index e26abbda29..05036fea8e 100644 --- a/src/lib/elementary/elm_actionslider.c +++ b/src/lib/elementary/elm_actionslider.c @@ -70,26 +70,6 @@ _get_pos_by_orientation(const Evas_Object *obj, return pos; } -EOLIAN static void -_elm_actionslider_elm_layout_sizing_eval(Eo *obj, Elm_Actionslider_Data *sd) -{ - Evas_Coord minw = -1, minh = -1; - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - evas_object_size_hint_min_set(sd->drag_button_base, minw, minh); - evas_object_size_hint_max_set(sd->drag_button_base, -1, -1); - - minw = -1; - minh = -1; - elm_coords_finger_size_adjust(3, &minw, 1, &minh); - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); -} - static void _mirroredness_change_eval(Evas_Object *obj) { @@ -480,14 +460,19 @@ _elm_actionslider_text_get(Eo *obj, Elm_Actionslider_Data *_pd EINA_UNUSED, cons EOLIAN static void _elm_actionslider_efl_canvas_group_group_add(Eo *obj, Elm_Actionslider_Data *priv) { + Evas_Coord minw = -1, minh = -1; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); priv->enabled_position = ELM_ACTIONSLIDER_ALL; + efl_ui_layout_finger_size_multiplier_set(obj, 3, 1); + priv->drag_button_base = evas_object_rectangle_add(evas_object_evas_get(obj)); + elm_coords_finger_size_adjust(1, &minw, 1, &minh); + evas_object_size_hint_min_set(priv->drag_button_base, minw, minh); evas_object_color_set(priv->drag_button_base, 0, 0, 0, 0); // dirty support for the backward compatibility @@ -655,7 +640,6 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX) #define ELM_ACTIONSLIDER_EXTRA_OPS \ ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX), \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_actionslider), \ EFL_CANVAS_GROUP_ADD_OPS(elm_actionslider) #include "elm_actionslider_eo.c" diff --git a/src/lib/elementary/elm_box.c b/src/lib/elementary/elm_box.c index 68e5996c78..73a73092c1 100644 --- a/src/lib/elementary/elm_box.c +++ b/src/lib/elementary/elm_box.c @@ -306,6 +306,7 @@ _elm_box_efl_canvas_group_group_calculate(Eo *obj, Elm_Box_Data *_pd EINA_UNUSED { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); elm_box_recalculate(obj); } diff --git a/src/lib/elementary/elm_bubble.c b/src/lib/elementary/elm_bubble.c index b3eacc01fe..df395831a4 100644 --- a/src/lib/elementary/elm_bubble.c +++ b/src/lib/elementary/elm_bubble.c @@ -53,19 +53,6 @@ static const char *corner_string[] = "bottom_right" }; -EOLIAN static void -_elm_bubble_elm_layout_sizing_eval(Eo *obj, Elm_Bubble_Data *_pd EINA_UNUSED) -{ - Evas_Coord minw = -1, minh = -1; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); -} - static void _on_mouse_up(void *data, Evas *e EINA_UNUSED, @@ -242,7 +229,6 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX) #define ELM_BUBBLE_EXTRA_OPS \ ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \ ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX), \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_bubble), \ EFL_CANVAS_GROUP_ADD_OPS(elm_bubble) #include "elm_bubble_eo.c" diff --git a/src/lib/elementary/elm_calendar.c b/src/lib/elementary/elm_calendar.c index 74619d4a65..e6de3373c6 100644 --- a/src/lib/elementary/elm_calendar.c +++ b/src/lib/elementary/elm_calendar.c @@ -125,22 +125,6 @@ _mark_free(Elm_Calendar_Mark *mark) free(mark); } -EOLIAN static void -_elm_calendar_elm_layout_sizing_eval(Eo *obj, Elm_Calendar_Data *_pd EINA_UNUSED) -{ - Evas_Coord minw = -1, minh = -1; - ELM_CALENDAR_DATA_GET(obj, sd); - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - if (sd->filling) return; - // 7x8 (1 month+year, days, 6 dates.) - elm_coords_finger_size_adjust(7, &minw, 8, &minh); - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); -} - static inline int _maxdays_get(struct tm *selected_time, int month_offset) { @@ -1304,12 +1288,10 @@ _elm_calendar_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Calendar_Data *sd EOLIAN static void _elm_calendar_efl_canvas_group_group_calculate(Eo *obj, Elm_Calendar_Data *_pd EINA_UNUSED) { - elm_layout_freeze(obj); - + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); _set_headers(obj); _populate(obj); - - elm_layout_thaw(obj); + efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); } static void @@ -1391,6 +1373,9 @@ _elm_calendar_efl_canvas_group_group_add(Eo *obj, Elm_Calendar_Data *priv) _spinner_buttons_add(obj, priv); + // 7x8 (1 month+year, days, 6 dates.) + efl_ui_layout_finger_size_multiplier_set(obj, 7, 8); + evas_object_smart_changed(obj); // ACCESS @@ -1925,7 +1910,6 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_calendar, Elm_Calendar_Data) /* Internal EO APIs and hidden overrides */ #define ELM_CALENDAR_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_calendar), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_calendar) #include "elm_calendar_eo.c" diff --git a/src/lib/elementary/elm_colorselector.c b/src/lib/elementary/elm_colorselector.c index 5b40c537cd..bb1d5f4444 100644 --- a/src/lib/elementary/elm_colorselector.c +++ b/src/lib/elementary/elm_colorselector.c @@ -1500,7 +1500,7 @@ _picker_sizing_eval(Evas_Object *obj) } EOLIAN static void -_elm_colorselector_elm_layout_sizing_eval(Eo *obj, Elm_Colorselector_Data *sd) +_elm_colorselector_efl_canvas_group_calculate(Eo *obj, Elm_Colorselector_Data *sd) { Evas_Coord minw = -1, minh = -1; @@ -2747,7 +2747,7 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_colorselector, Elm_Colorselector_Data) /* Internal EO APIs and hidden overrides */ #define ELM_COLORSELECTOR_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_colorselector), \ + EFL_CANVAS_GROUP_CALC_OPS(elm_colorselector), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_colorselector) #include "elm_colorselector_eo.c" diff --git a/src/lib/elementary/elm_dayselector.c b/src/lib/elementary/elm_dayselector.c index fb5fb5cdf8..29236edace 100644 --- a/src/lib/elementary/elm_dayselector.c +++ b/src/lib/elementary/elm_dayselector.c @@ -36,18 +36,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { {NULL, NULL} }; -EOLIAN static void -_elm_dayselector_elm_layout_sizing_eval(Eo *obj, Elm_Dayselector_Data *sd EINA_UNUSED) -{ - Evas_Coord min_w = -1, min_h = -1; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - elm_coords_finger_size_adjust(ELM_DAYSELECTOR_MAX, &min_w, 1, &min_h); - edje_object_size_min_restricted_calc - (wd->resize_obj, &min_w, &min_h, min_w, min_h); - evas_object_size_hint_min_set(obj, min_w, min_h); -} - static void _dayselector_resize(void *data, Evas *e EINA_UNUSED, @@ -452,6 +440,7 @@ _elm_dayselector_efl_canvas_group_group_add(Eo *obj, Elm_Dayselector_Data *priv) priv->week_start = _elm_config->week_start; priv->weekend_start = _elm_config->weekend_start; priv->weekend_len = _elm_config->weekend_len; + efl_ui_layout_finger_size_multiplier_set(obj, ELM_DAYSELECTOR_MAX, 1); _items_create(obj); evas_object_event_callback_add @@ -648,7 +637,6 @@ ELM_PART_OVERRIDE_CONTENT_UNSET(elm_dayselector, ELM_DAYSELECTOR, Elm_Dayselecto /* Internal EO APIs and hidden overrides */ #define ELM_DAYSELECTOR_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_dayselector), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_dayselector) #include "elm_dayselector_eo.c" diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c index 22dcaff458..0de3937f7c 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c @@ -1135,7 +1135,7 @@ _deferred_recalc_job(void *data) } EOLIAN static void -_elm_entry_elm_layout_sizing_eval(Eo *obj, Elm_Entry_Data *sd) +_elm_entry_efl_canvas_group_calculate(Eo *obj, Elm_Entry_Data *sd) { Evas_Coord minw = -1, minh = -1; Evas_Coord resw, resh; @@ -6261,6 +6261,6 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX) EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_entry), \ ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX), \ ELM_LAYOUT_TEXT_ALIASES_OPS(MY_CLASS_PFX), \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_entry) + EFL_CANVAS_GROUP_CALC_OPS(elm_entry) #include "elm_entry_eo.c" diff --git a/src/lib/elementary/elm_flipselector.c b/src/lib/elementary/elm_flipselector.c index 53bc6d0ce9..2fb5c98d6b 100644 --- a/src/lib/elementary/elm_flipselector.c +++ b/src/lib/elementary/elm_flipselector.c @@ -62,7 +62,7 @@ static const Elm_Action key_actions[] = { }; EOLIAN static void -_elm_flipselector_elm_layout_sizing_eval(Eo *obj, Elm_Flipselector_Data *sd) +_elm_flipselector_efl_canvas_group_calculate(Eo *obj, Elm_Flipselector_Data *sd) { char *tmp = NULL; Evas_Coord minw = -1, minh = -1, w, h; @@ -93,6 +93,7 @@ _elm_flipselector_elm_layout_sizing_eval(Eo *obj, Elm_Flipselector_Data *sd) if (sd->sentinel) { elm_layout_text_set(obj, "elm.top", tmp); + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); free(tmp); } @@ -898,7 +899,7 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_flipselector, Elm_Flipselector_Data) /* Internal EO APIs and hidden overrides */ #define ELM_FLIPSELECTOR_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_flipselector), \ + EFL_CANVAS_GROUP_CALC_OPS(elm_flipselector), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_flipselector) #include "elm_flipselector_item_eo.c" diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c index 8c36f4b722..9c0fb19767 100644 --- a/src/lib/elementary/elm_gengrid.c +++ b/src/lib/elementary/elm_gengrid.c @@ -2196,6 +2196,7 @@ _elm_gengrid_pan_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Elm_Gengr Elm_Gengrid_Data *sd = psd->wsd; + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); if (!sd->nmax) return; sd->reorder_item_changed = EINA_FALSE; @@ -4055,7 +4056,7 @@ _elm_gengrid_item_new(Elm_Gengrid_Data *sd, } EOLIAN static void -_elm_gengrid_elm_layout_sizing_eval(Eo *obj, Elm_Gengrid_Data *sd) +_elm_gengrid_efl_canvas_group_calculate(Eo *obj, Elm_Gengrid_Data *sd) { Evas_Coord minw = 0, minh = 0, maxw = -1, maxh = -1, vw = 0, vh = 0; @@ -5892,7 +5893,7 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_gengrid, Elm_Gengrid_Data) /* Internal EO APIs and hidden overrides */ #define ELM_GENGRID_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_gengrid), \ + EFL_CANVAS_GROUP_CALC_OPS(elm_gengrid), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_gengrid) #include "elm_gengrid_eo.c" diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c index 76e79126d7..55b3b1d601 100644 --- a/src/lib/elementary/elm_genlist.c +++ b/src/lib/elementary/elm_genlist.c @@ -925,7 +925,7 @@ _calc_job(void *data) } EOLIAN static void -_elm_genlist_elm_layout_sizing_eval(Eo *obj, Elm_Genlist_Data *sd) +_elm_genlist_efl_canvas_group_calculate(Eo *obj, Elm_Genlist_Data *sd) { Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; Evas_Coord vmw = 0, vmh = 0; @@ -2617,6 +2617,7 @@ _elm_genlist_pan_efl_canvas_group_group_calculate(Eo *obj, Elm_Genlist_Pan_Data Elm_Genlist_Data *sd = psd->wsd; + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); evas_event_freeze(e); if (sd->pan_changed) @@ -8958,7 +8959,7 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_genlist, Elm_Genlist_Data) /* Internal EO APIs and hidden overrides */ #define ELM_GENLIST_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_genlist), \ + EFL_CANVAS_GROUP_CALC_OPS(elm_genlist), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_genlist) #define ELM_GENLIST_PAN_EXTRA_OPS \ diff --git a/src/lib/elementary/elm_hover.c b/src/lib/elementary/elm_hover.c index 446cc508b5..899ffef3ac 100644 --- a/src/lib/elementary/elm_hover.c +++ b/src/lib/elementary/elm_hover.c @@ -315,7 +315,7 @@ _elm_hover_efl_ui_widget_theme_apply(Eo *obj, Elm_Hover_Data *sd) } EOLIAN static void -_elm_hover_elm_layout_sizing_eval(Eo *obj, Elm_Hover_Data *sd) +_elm_hover_efl_canvas_group_calculate(Eo *obj, Elm_Hover_Data *sd) { Evas_Coord ofs_x, x = 0, y = 0, w = 0, h = 0, x2 = 0, y2 = 0, w2 = 0, h2 = 0; @@ -877,7 +877,7 @@ ELM_PART_OVERRIDE_CONTENT_UNSET(elm_hover, ELM_HOVER, Elm_Hover_Data) #define ELM_HOVER_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_hover), \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_hover), \ + EFL_CANVAS_GROUP_CALC_OPS(elm_hover), \ _ELM_LAYOUT_ALIASES_OPS(elm_hover, content) #include "elm_hover_eo.c" diff --git a/src/lib/elementary/elm_index.c b/src/lib/elementary/elm_index.c index f9bb2b2022..00ac57c711 100644 --- a/src/lib/elementary/elm_index.c +++ b/src/lib/elementary/elm_index.c @@ -516,17 +516,6 @@ _elm_index_efl_ui_widget_theme_apply(Eo *obj, Elm_Index_Data *sd) return int_ret; } -EOLIAN static void -_elm_index_elm_layout_sizing_eval(Eo *obj, Elm_Index_Data *_pd EINA_UNUSED) -{ - Evas_Coord minw = -1, minh = -1; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - edje_object_size_min_calc(wd->resize_obj, &minw, &minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); -} - EOLIAN static void _elm_index_item_efl_object_destructor(Eo *eo_item EINA_UNUSED, Elm_Index_Item_Data *it) { @@ -1704,7 +1693,6 @@ _elm_index_item_efl_access_widget_action_elm_actions_get(const Eo *eo_it EINA_UN /* Internal EO APIs and hidden overrides */ #define ELM_INDEX_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_index), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_index) #include "elm_index_item_eo.c" diff --git a/src/lib/elementary/elm_inwin.c b/src/lib/elementary/elm_inwin.c index e50128027e..872d89d64c 100644 --- a/src/lib/elementary/elm_inwin.c +++ b/src/lib/elementary/elm_inwin.c @@ -26,20 +26,10 @@ typedef struct { } Elm_Inwin_Data; EOLIAN static void -_elm_inwin_elm_layout_sizing_eval(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED) +_elm_inwin_efl_canvas_group_calculate(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED) { - Evas_Object *content; - Evas_Coord minw = -1, minh = -1; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - content = elm_layout_content_get(obj, NULL); - - if (!content) return; - - edje_object_size_min_calc(wd->resize_obj, &minw, &minh); - - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); + if (elm_layout_content_get(obj, NULL)) + efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); } EOLIAN static void @@ -132,6 +122,6 @@ ELM_PART_CONTENT_DEFAULT_IMPLEMENT(elm_inwin, Elm_Inwin_Data) #define ELM_INWIN_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_OPS(elm_inwin), \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_inwin) + EFL_CANVAS_GROUP_CALC_OPS(elm_inwin) #include "elm_inwin_eo.c" diff --git a/src/lib/elementary/elm_label.c b/src/lib/elementary/elm_label.c index 4468b72bd0..c052cfef1c 100644 --- a/src/lib/elementary/elm_label.c +++ b/src/lib/elementary/elm_label.c @@ -208,7 +208,7 @@ _elm_label_efl_ui_widget_theme_apply(Eo *obj, Elm_Label_Data *sd) } EOLIAN static void -_elm_label_elm_layout_sizing_eval(Eo *obj, Elm_Label_Data *_pd EINA_UNUSED) +_elm_label_efl_canvas_group_calculate(Eo *obj, Elm_Label_Data *_pd EINA_UNUSED) { Evas_Coord minw = -1, minh = -1; Evas_Coord resw, resh; @@ -627,7 +627,7 @@ ELM_PART_OVERRIDE_TEXT_SET(elm_label, ELM_LABEL, Elm_Label_Data) /* Internal EO APIs and hidden overrides */ #define ELM_LABEL_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_label), \ + EFL_CANVAS_GROUP_CALC_OPS(elm_label), \ EFL_CANVAS_GROUP_ADD_OPS(elm_label) #include "elm_label_eo.c" diff --git a/src/lib/elementary/elm_list.c b/src/lib/elementary/elm_list.c index 79b90cff16..0c758f9e1c 100644 --- a/src/lib/elementary/elm_list.c +++ b/src/lib/elementary/elm_list.c @@ -691,7 +691,7 @@ _elm_list_efl_ui_l10n_translation_update(Eo *obj EINA_UNUSED, Elm_List_Data *sd) } EOLIAN static void -_elm_list_elm_layout_sizing_eval(Eo *obj, Elm_List_Data *sd) +_elm_list_efl_canvas_group_calculate(Eo *obj, Elm_List_Data *sd) { Evas_Coord vw = 0, vh = 0; Evas_Coord minw = 0, minh = 0, maxw = 0, maxh = 0, w = 0, h = 0, vmw = 0, vmh = 0; @@ -700,6 +700,9 @@ _elm_list_elm_layout_sizing_eval(Eo *obj, Elm_List_Data *sd) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); if (!efl_finalized_get(obj)) return; //not constructed yet + if (efl_canvas_group_need_recalculate_get(sd->box)) + efl_canvas_group_calculate(sd->box); + evas_object_size_hint_combined_min_get(sd->box, &minw, &minh); evas_object_size_hint_max_get(sd->box, &maxw, &maxh); evas_object_size_hint_weight_get(sd->box, &xw, &yw); @@ -836,6 +839,7 @@ _items_fix(Evas_Object *obj) Evas_Coord mw, mh; int i, redo = 0; Eina_Array walk; + Eina_Bool hints_changed = EINA_FALSE; const char *style; const char *it_odd; @@ -999,6 +1003,12 @@ _items_fix(Evas_Object *obj) mw = mw > ew ? mw : ew; mh = mh > eh ? mh : eh; */ + { + int pmw, pmh; + /* if size changed, flag box for recalc to pull in new sizes */ + evas_object_size_hint_min_get(VIEW(it), &pmw, &pmh); + hints_changed |= pmw != mh || pmh != mh; + } evas_object_size_hint_min_set(VIEW(it), mw, mh); evas_object_show(VIEW(it)); } @@ -1044,6 +1054,8 @@ _items_fix(Evas_Object *obj) sd->fixing_now = EINA_FALSE; _elm_list_unwalk(obj, sd); + if (hints_changed) + efl_canvas_group_need_recalculate_set(sd->box, 1); //focus highlight in_theme is set by list item theme. _elm_widget_item_highlight_in_theme( @@ -3211,7 +3223,7 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_list, Elm_List_Data) /* Internal EO APIs and hidden overrides */ #define ELM_LIST_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_list), \ + EFL_CANVAS_GROUP_CALC_OPS(elm_list), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_list) #include "elm_list_eo.c" diff --git a/src/lib/elementary/elm_map.c b/src/lib/elementary/elm_map.c index ab6da777d0..995197ba7a 100644 --- a/src/lib/elementary/elm_map.c +++ b/src/lib/elementary/elm_map.c @@ -3937,6 +3937,7 @@ _elm_map_pan_efl_canvas_group_group_calculate(Eo *obj, Elm_Map_Pan_Data *psd) { Evas_Coord w, h; + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); evas_object_geometry_get(obj, NULL, NULL, &w, &h); if (w <= 0 || h <= 0) return; diff --git a/src/lib/elementary/elm_panel.c b/src/lib/elementary/elm_panel.c index 033c892adc..1d8eae25fe 100644 --- a/src/lib/elementary/elm_panel.c +++ b/src/lib/elementary/elm_panel.c @@ -56,10 +56,8 @@ _mirrored_set(Evas_Object *obj, } EOLIAN static void -_elm_panel_elm_layout_sizing_eval(Eo *obj, Elm_Panel_Data *sd) +_elm_panel_efl_canvas_group_calculate(Eo *obj, Elm_Panel_Data *sd) { - Evas_Coord mw = 0, mh = 0; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); if (sd->delete_me) return; @@ -70,10 +68,7 @@ _elm_panel_elm_layout_sizing_eval(Eo *obj, Elm_Panel_Data *sd) else _drawer_open(obj, wd->w, wd->h, EINA_FALSE); } - evas_object_smart_calculate(sd->bx); - edje_object_size_min_calc(wd->resize_obj, &mw, &mh); - evas_object_size_hint_min_set(obj, mw, mh); - evas_object_size_hint_max_set(obj, -1, -1); + efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); } static char * @@ -854,6 +849,9 @@ _elm_panel_efl_canvas_group_group_add(Eo *obj, Elm_Panel_Data *priv) else { efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"), priv->bx); + /* trigger box recalc on manual panel calc */ + _efl_ui_layout_subobjs_calc_set(obj, EINA_TRUE); + efl_ui_layout_finger_size_multiplier_set(obj, 0, 0); if (edje_object_part_exists (wd->resize_obj, "elm.swallow.event")) @@ -1524,7 +1522,7 @@ ELM_PART_OVERRIDE_CONTENT_UNSET(elm_panel, ELM_PANEL, Elm_Panel_Data) /* Internal EO APIs and hidden overrides */ #define ELM_PANEL_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_panel), \ + EFL_CANVAS_GROUP_CALC_OPS(elm_panel), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_panel) #include "elm_panel_eo.c" diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h index e621edf3c0..82faa149ea 100644 --- a/src/lib/elementary/elm_priv.h +++ b/src/lib/elementary/elm_priv.h @@ -956,8 +956,8 @@ void efl_ui_slider_move_knob(Evas_Object *obj, double button_x, double button_y) # define ELM_LAYOUT_CONTENT_ALIASES_OPS(_pfx) _ELM_LAYOUT_ALIASES_OPS(_pfx, content) # define ELM_LAYOUT_TEXT_ALIASES_OPS(_pfx) _ELM_LAYOUT_ALIASES_OPS(_pfx, text) -# define ELM_LAYOUT_SIZING_EVAL_OPS(_pfx) \ - EFL_OBJECT_OP_FUNC(elm_layout_sizing_eval, _##_pfx##_elm_layout_sizing_eval) +# define EFL_CANVAS_GROUP_CALC_OPS(_pfx) \ + EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _##_pfx##_efl_canvas_group_calculate) # define ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(_pfx, _typ) \ EOLIAN static Eina_Bool \ diff --git a/src/lib/elementary/elm_scroller.c b/src/lib/elementary/elm_scroller.c index c7a7054bd7..f22939f6a4 100644 --- a/src/lib/elementary/elm_scroller.c +++ b/src/lib/elementary/elm_scroller.c @@ -326,7 +326,7 @@ _elm_scroller_efl_ui_widget_on_access_activate(Eo *obj, Elm_Scroller_Data *_pd E } EOLIAN static void -_elm_scroller_elm_layout_sizing_eval(Eo *obj, Elm_Scroller_Data *sd) +_elm_scroller_efl_canvas_group_calculate(Eo *obj, Elm_Scroller_Data *sd) { Evas_Coord vw = 0, vh = 0, minw = 0, minh = 0, maxw = 0, maxh = 0, w, h, vmw, vmh; @@ -1402,7 +1402,7 @@ ELM_PART_OVERRIDE_CONTENT_UNSET(elm_scroller, ELM_SCROLLER, Elm_Scroller_Data) /* Internal EO APIs and hidden overrides */ #define ELM_SCROLLER_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_scroller), \ + EFL_CANVAS_GROUP_CALC_OPS(elm_scroller), \ EFL_CANVAS_GROUP_ADD_OPS(elm_scroller) #include "elm_scroller_eo.c" diff --git a/src/lib/elementary/elm_segment_control.c b/src/lib/elementary/elm_segment_control.c index 0a6a3d1a19..d036b97556 100644 --- a/src/lib/elementary/elm_segment_control.c +++ b/src/lib/elementary/elm_segment_control.c @@ -39,29 +39,6 @@ _elm_segment_control_efl_ui_l10n_translation_update(Eo *obj EINA_UNUSED, Elm_Seg efl_ui_l10n_translation_update(efl_super(obj, MY_CLASS)); } -EOLIAN static void -_elm_segment_control_elm_layout_sizing_eval(Eo *obj, Elm_Segment_Control_Data *sd) -{ - Evas_Coord minw = -1, minh = -1; - Evas_Coord w, h; - int item_count; - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - item_count = eina_list_count(sd->items); - - elm_coords_finger_size_adjust(item_count, &minw, 1, &minh); - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - - evas_object_size_hint_combined_min_get(obj, &w, &h); - - if (w > minw) minw = w; - if (h > minh) minh = h; - - evas_object_size_hint_min_set(obj, minw, minh); -} - static void _item_free(Elm_Segment_Control_Item_Data *it) { @@ -142,6 +119,7 @@ _update_list(Elm_Segment_Control_Data *sd) _position_items(sd); item_count = eina_list_count(sd->items); + efl_ui_layout_finger_size_multiplier_set(sd->obj, item_count, 1); if (item_count == 1) { @@ -825,7 +803,6 @@ _elm_segment_control_item_efl_ui_focus_object_focus_parent_get(const Eo *obj EIN /* Internal EO APIs and hidden overrides */ #define ELM_SEGMENT_CONTROL_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_segment_control), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_segment_control) #include "elm_segment_control_item_eo.c" diff --git a/src/lib/elementary/elm_separator.c b/src/lib/elementary/elm_separator.c index 792a74294f..4581da0742 100644 --- a/src/lib/elementary/elm_separator.c +++ b/src/lib/elementary/elm_separator.c @@ -32,18 +32,6 @@ _elm_separator_efl_ui_widget_theme_apply(Eo *obj, Elm_Separator_Data *sd EINA_UN return int_ret; } -EOLIAN static void -_elm_separator_elm_layout_sizing_eval(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED) -{ - Evas_Coord minw = -1, minh = -1; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - edje_object_size_min_calc(wd->resize_obj, &minw, &minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); - evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL); -} - EOLIAN static void _elm_separator_efl_canvas_group_group_add(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED) { @@ -70,6 +58,8 @@ _elm_separator_efl_object_constructor(Eo *obj, Elm_Separator_Data *sd EINA_UNUSE obj = efl_constructor(efl_super(obj, MY_CLASS)); efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_SEPARATOR); + efl_ui_layout_finger_size_multiplier_set(obj, 0, 0); + evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL); return obj; } @@ -100,7 +90,6 @@ _elm_separator_class_constructor(Efl_Class *klass) /* Internal EO APIs and hidden overrides */ #define ELM_SEPARATOR_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_separator), \ EFL_CANVAS_GROUP_ADD_OPS(elm_separator) #include "elm_separator_eo.c" diff --git a/src/lib/elementary/elm_slider.c b/src/lib/elementary/elm_slider.c index a603894be7..c836723eaa 100644 --- a/src/lib/elementary/elm_slider.c +++ b/src/lib/elementary/elm_slider.c @@ -894,8 +894,9 @@ _spacer_up_cb(void *data, EOLIAN static void _elm_slider_efl_canvas_group_group_calculate(Eo *obj, Elm_Slider_Data *sd) { + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); + edje_object_freeze(obj); EFL_UI_SLIDER_DATA_GET(obj, sd2); - elm_layout_freeze(obj); if (_is_horizontal(sd2->dir)) evas_object_size_hint_min_set @@ -910,7 +911,8 @@ _elm_slider_efl_canvas_group_group_calculate(Eo *obj, Elm_Slider_Data *sd) _units_set(obj); _indicator_set(obj); - elm_layout_thaw(obj); + edje_object_thaw(obj); + efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); } static void diff --git a/src/lib/elementary/elm_slideshow.c b/src/lib/elementary/elm_slideshow.c index da8887413d..5ab5e662f6 100644 --- a/src/lib/elementary/elm_slideshow.c +++ b/src/lib/elementary/elm_slideshow.c @@ -74,17 +74,6 @@ _key_action_pause(Evas_Object *obj, const char *params EINA_UNUSED) return EINA_TRUE; } -EOLIAN static void -_elm_slideshow_elm_layout_sizing_eval(Eo *obj, Elm_Slideshow_Data *_pd EINA_UNUSED) -{ - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - Evas_Coord minw = -1, minh = -1; - - edje_object_size_min_calc(wd->resize_obj, &minw, &minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, minw, minh); -} - static Elm_Slideshow_Item_Data * _item_prev_get(Elm_Slideshow_Item_Data *item) { @@ -310,6 +299,7 @@ _elm_slideshow_efl_canvas_group_group_add(Eo *obj, Elm_Slideshow_Data *priv) ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); efl_canvas_group_add(efl_super(obj, MY_CLASS)); + efl_ui_layout_finger_size_multiplier_set(obj, 0, 0); priv->count_item_pre_before = 2; priv->count_item_pre_after = 2; @@ -713,7 +703,6 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_slideshow, Elm_Slideshow_Data) /* Internal EO APIs and hidden overrides */ #define ELM_SLIDESHOW_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_slideshow), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_slideshow) #include "elm_slideshow_item_eo.c" diff --git a/src/lib/elementary/elm_spinner.c b/src/lib/elementary/elm_spinner.c index c033e9a732..355b9469fb 100644 --- a/src/lib/elementary/elm_spinner.c +++ b/src/lib/elementary/elm_spinner.c @@ -922,20 +922,6 @@ _inc_dec_button_mouse_move_cb(void *data, const Efl_Event *event) } } -EOLIAN static void -_elm_spinner_elm_layout_sizing_eval(Eo *obj, Elm_Spinner_Data *_pd EINA_UNUSED) -{ - Evas_Coord minw = -1, minh = -1; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - edje_object_size_min_restricted_calc - (wd->resize_obj, &minw, &minh, minw, minh); - elm_coords_finger_size_adjust(1, &minw, 1, &minh); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, -1, -1); -} - EOLIAN static Eina_Bool _elm_spinner_efl_ui_focus_object_on_focus_update(Eo *obj, Elm_Spinner_Data *sd) { @@ -1718,7 +1704,6 @@ _elm_spinner_efl_access_object_i18n_name_get(const Eo *obj, Elm_Spinner_Data *sd /* Internal EO APIs and hidden overrides */ #define ELM_SPINNER_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(elm_spinner), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_spinner) #include "elm_spinner_eo.c" diff --git a/src/lib/elementary/elm_table.c b/src/lib/elementary/elm_table.c index fa07e5912b..39c1031536 100644 --- a/src/lib/elementary/elm_table.c +++ b/src/lib/elementary/elm_table.c @@ -336,6 +336,7 @@ _elm_table_efl_canvas_group_group_calculate(Eo *obj, void *pd EINA_UNUSED) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); evas_object_smart_calculate(wd->resize_obj); } diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c index e469a05898..741452697d 100644 --- a/src/lib/elementary/elm_toolbar.c +++ b/src/lib/elementary/elm_toolbar.c @@ -4006,6 +4006,7 @@ _elm_toolbar_efl_access_selection_child_deselect(Eo *obj EINA_UNUSED, Elm_Toolba EOLIAN void _elm_toolbar_efl_canvas_group_group_calculate(Eo *obj, Elm_Toolbar_Data *pd EINA_UNUSED) { + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); _sizing_eval(obj); }