From f4a4f5522d376cf1c521f37ce851c26a009d19e1 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 30 Jul 2019 13:11:41 -0400 Subject: [PATCH] efl_ui/layout_base: add subobjs_calc internal functionality Summary: this functionality forces group_calc on a layout's subobjects during layout group_calc so that the layout's own group_calc will yield consistent and correct results currently this is only used in panel widgets Depends on D9437 Reviewers: bu5hm4n Reviewed By: bu5hm4n Subscribers: bu5hm4n, cedric, #reviewers, #committers Tags: #efl_widgets Maniphest Tasks: T8059 Differential Revision: https://phab.enlightenment.org/D9438 --- src/lib/elementary/efl_ui_anchor_popup.c | 32 +++------- src/lib/elementary/efl_ui_box.c | 1 + src/lib/elementary/efl_ui_button.c | 13 ---- src/lib/elementary/efl_ui_calendar.c | 28 ++------- src/lib/elementary/efl_ui_check.c | 16 +---- src/lib/elementary/efl_ui_clock.c | 21 ++----- src/lib/elementary/efl_ui_clock.eo | 1 + src/lib/elementary/efl_ui_datepicker.c | 17 ----- src/lib/elementary/efl_ui_frame.c | 11 +--- src/lib/elementary/efl_ui_image_zoomable.c | 1 + src/lib/elementary/efl_ui_internal_text_scroller.c | 6 +- .../elementary/efl_ui_internal_text_scroller.eo | 1 + src/lib/elementary/efl_ui_item.c | 39 +----------- src/lib/elementary/efl_ui_item.eo | 1 - src/lib/elementary/efl_ui_layout.c | 24 +++++++- src/lib/elementary/efl_ui_list_view.c | 1 + src/lib/elementary/efl_ui_pan.c | 1 + src/lib/elementary/efl_ui_panel.c | 15 ++--- src/lib/elementary/efl_ui_panel.eo | 1 + src/lib/elementary/efl_ui_panes.c | 6 +- src/lib/elementary/efl_ui_panes.eo | 1 + src/lib/elementary/efl_ui_popup.c | 72 ++++------------------ src/lib/elementary/efl_ui_popup_private.h | 3 - src/lib/elementary/efl_ui_progressbar.c | 15 +---- src/lib/elementary/efl_ui_relative_layout.c | 1 + src/lib/elementary/efl_ui_scroll_alert_popup.c | 16 +++-- src/lib/elementary/efl_ui_scroller.c | 6 +- src/lib/elementary/efl_ui_scroller.eo | 1 + src/lib/elementary/efl_ui_slider.c | 14 ----- src/lib/elementary/efl_ui_spin.c | 17 ----- src/lib/elementary/efl_ui_table.c | 1 + src/lib/elementary/efl_ui_tags.c | 18 ------ src/lib/elementary/efl_ui_text.c | 7 +-- src/lib/elementary/efl_ui_text.eo | 1 + src/lib/elementary/efl_ui_text_alert_popup.c | 17 +++-- src/lib/elementary/efl_ui_textpath.c | 3 +- src/lib/elementary/efl_ui_timepicker.c | 17 ----- src/lib/elementary/efl_ui_video.c | 4 +- src/lib/elementary/efl_ui_video.eo | 1 + src/lib/elementary/efl_ui_widget.c | 1 + src/lib/elementary/elc_ctxpopup.c | 4 +- src/lib/elementary/elc_fileselector_entry.c | 14 +---- src/lib/elementary/elc_multibuttonentry.c | 16 ----- src/lib/elementary/elc_naviframe.c | 4 +- src/lib/elementary/elc_player.c | 14 +---- src/lib/elementary/elc_popup.c | 4 +- src/lib/elementary/elm_actionslider.c | 26 ++------ src/lib/elementary/elm_box.c | 1 + src/lib/elementary/elm_bubble.c | 14 ----- src/lib/elementary/elm_calendar.c | 26 ++------ src/lib/elementary/elm_colorselector.c | 4 +- src/lib/elementary/elm_dayselector.c | 14 +---- src/lib/elementary/elm_entry.c | 4 +- src/lib/elementary/elm_flipselector.c | 5 +- src/lib/elementary/elm_gengrid.c | 5 +- src/lib/elementary/elm_genlist.c | 5 +- src/lib/elementary/elm_hover.c | 4 +- src/lib/elementary/elm_index.c | 12 ---- src/lib/elementary/elm_inwin.c | 18 ++---- src/lib/elementary/elm_label.c | 4 +- src/lib/elementary/elm_list.c | 16 ++++- src/lib/elementary/elm_map.c | 1 + src/lib/elementary/elm_panel.c | 14 ++--- src/lib/elementary/elm_priv.h | 4 +- src/lib/elementary/elm_scroller.c | 4 +- src/lib/elementary/elm_segment_control.c | 25 +------- src/lib/elementary/elm_separator.c | 15 +---- src/lib/elementary/elm_slider.c | 6 +- src/lib/elementary/elm_slideshow.c | 13 +--- src/lib/elementary/elm_spinner.c | 15 ----- src/lib/elementary/elm_table.c | 1 + src/lib/elementary/elm_toolbar.c | 1 + src/lib/elementary/elm_widget_layout.h | 3 + 73 files changed, 188 insertions(+), 580 deletions(-) diff --git a/src/lib/elementary/efl_ui_anchor_popup.c b/src/lib/elementary/efl_ui_anchor_popup.c index 5709956..47bf9a5 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 1d42d36..b9871cc 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 49016e2..3ff1c52 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) { @@ -413,7 +401,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 d905324..8c21646 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 34efd49..9934c7a 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) { @@ -408,8 +395,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 7c8047b..5035fdd 100644 --- a/src/lib/elementary/efl_ui_clock.c +++ b/src/lib/elementary/efl_ui_clock.c @@ -489,6 +489,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++) @@ -666,21 +667,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 @@ -1294,6 +1285,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); @@ -1418,7 +1410,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 e7a568a..fd24b6b 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 666791b..a8cf48d 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 e72aba0..22d2057 100644 --- a/src/lib/elementary/efl_ui_frame.c +++ b/src/lib/elementary/efl_ui_frame.c @@ -140,14 +140,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 69e75b0..3dfb23d 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -383,6 +383,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 0773b97..cf6f9fb 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 b18c008..ea0d573 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 65ecf71..edbfd74 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 aa76004..a2a7ad7 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 fd0408d..6178b3a 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -181,6 +181,14 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd) if (!efl_alive_get(obj)) return; + if (sd->calc_subobjs && !evas_smart_objects_calculating_get(evas_object_evas_get(obj))) + { + Eina_List *l; + Eo *subobj; + /* user has manually triggered a smart calc and wants subobjs to also calc */ + EINA_LIST_FOREACH(wd->subobjs, l, subobj) + efl_canvas_group_calculate(subobj); + } elm_coords_finger_size_adjust(sd->finger_size_multiplier_x, &rest_w, sd->finger_size_multiplier_y, &rest_h); if (elm_widget_is_legacy(obj)) @@ -210,10 +218,18 @@ _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; } +void +_efl_ui_layout_subobjs_calc_set(Eo *obj, Eina_Bool set) +{ + Efl_Ui_Layout_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); + EINA_SAFETY_ON_NULL_RETURN(sd); + sd->calc_subobjs = !!set; +} + /* common content cases for layout objects: icon and text */ static inline void _signals_emit(Eo *obj, @@ -593,6 +609,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; } @@ -2733,6 +2754,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 49121a2..2431c96 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 3412cba..7537936 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 eba318d..cad4a8f 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 fffe726..39b3100 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 b4a5484..5bfadac 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")); @@ -757,8 +758,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 0ce334c..0be63cb 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 214758d..007e5f5 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; - } - - Eina_Rect p_geom = efl_gfx_entity_geometry_get(pd->win_parent); + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); + _sizing_eval(obj); + _calc_align(obj); - 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)); + Eina_Rect p_geom = efl_gfx_entity_geometry_get(pd->win_parent); - 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 3cf0eee..77b989a 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 e693fdd..f3ce052 100644 --- a/src/lib/elementary/efl_ui_progressbar.c +++ b/src/lib/elementary/efl_ui_progressbar.c @@ -137,18 +137,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) @@ -355,6 +343,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; @@ -839,7 +829,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 bb21e55..ceebf89 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 9836f8d..476178d 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 3f7fb20..9ebc526 100644 --- a/src/lib/elementary/efl_ui_scroller.c +++ b/src/lib/elementary/efl_ui_scroller.c @@ -294,13 +294,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) @@ -397,7 +398,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 8f90d23..36f42c1 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 513e00d..a72ac65 100644 --- a/src/lib/elementary/efl_ui_slider.c +++ b/src/lib/elementary/efl_ui_slider.c @@ -458,19 +458,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, @@ -904,7 +891,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 bbfeba7..636e3fe 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 9b903a8..24fa927 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 4496814..07f6ac0 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 b76c69e..f9a575f 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 a0a1807..b52a392 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 fd22768..16fd530 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 ee16a2f..c06cbf6 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 6d568bc..d7dd01a 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 fe26077..a80ce0a 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 ab9c3ce..9ecdc35 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 c66d6d7..72a4509 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -1091,6 +1091,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 3ecab75..ff2e52d 100644 --- a/src/lib/elementary/elc_ctxpopup.c +++ b/src/lib/elementary/elc_ctxpopup.c @@ -616,7 +616,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}; @@ -1869,7 +1869,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 bf9b706..13243b5 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 fb81850..76e09ef 100644 --- a/src/lib/elementary/elc_multibuttonentry.c +++ b/src/lib/elementary/elc_multibuttonentry.c @@ -1033,21 +1033,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, @@ -2414,7 +2399,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 03d4227..e25c60f 100644 --- a/src/lib/elementary/elc_naviframe.c +++ b/src/lib/elementary/elc_naviframe.c @@ -1018,7 +1018,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; @@ -2596,7 +2596,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 8c104d4..c5a17e0 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 7c5c276..d1df98e 100644 --- a/src/lib/elementary/elc_popup.c +++ b/src/lib/elementary/elc_popup.c @@ -722,7 +722,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; @@ -2740,7 +2740,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 e26abbd..05036fe 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 f4dc46c..83654d6 100644 --- a/src/lib/elementary/elm_box.c +++ b/src/lib/elementary/elm_box.c @@ -373,6 +373,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 b3eacc0..df39583 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 1a533ee..1f08f27 100644 --- a/src/lib/elementary/elm_calendar.c +++ b/src/lib/elementary/elm_calendar.c @@ -229,22 +229,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) { @@ -1805,12 +1789,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 @@ -1897,6 +1879,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 @@ -2459,7 +2444,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 b02281c..153cfb5 100644 --- a/src/lib/elementary/elm_colorselector.c +++ b/src/lib/elementary/elm_colorselector.c @@ -1542,7 +1542,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; @@ -2889,7 +2889,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 fb5fb5c..29236ed 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 f81e3a2..a6b4af4 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c @@ -1594,7 +1594,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; @@ -9350,7 +9350,7 @@ 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), \ /*********************************************************************************** \ * TIZEN_ONLY_FEATURE: apply Tizen's color_class features. * \ ***********************************************************************************/\ diff --git a/src/lib/elementary/elm_flipselector.c b/src/lib/elementary/elm_flipselector.c index 45d10ee..1631497 100644 --- a/src/lib/elementary/elm_flipselector.c +++ b/src/lib/elementary/elm_flipselector.c @@ -70,7 +70,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; @@ -101,6 +101,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); } @@ -1030,7 +1031,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 bdfaffb..e7e0c36 100755 --- a/src/lib/elementary/elm_gengrid.c +++ b/src/lib/elementary/elm_gengrid.c @@ -2564,6 +2564,7 @@ _elm_gengrid_pan_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Elm_Gengr //TIZEN_ONLY(20160511) : Remove job for fixing calculate timing issue. if (!sd->calc_done) _calc(sd->obj); // + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); if (!sd->nmax) return; //TIZEN_ONLY(20150825) : Use the specific wanted_region_set func only for gengrid. @@ -5390,7 +5391,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; @@ -7716,7 +7717,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 690bc63..5b647c5 100644 --- a/src/lib/elementary/elm_genlist.c +++ b/src/lib/elementary/elm_genlist.c @@ -990,7 +990,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; @@ -2743,6 +2743,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) @@ -9659,7 +9660,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 a1afeed..4af22b7 100644 --- a/src/lib/elementary/elm_hover.c +++ b/src/lib/elementary/elm_hover.c @@ -317,7 +317,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; @@ -925,7 +925,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 1344973..8f7a574 100644 --- a/src/lib/elementary/elm_index.c +++ b/src/lib/elementary/elm_index.c @@ -556,17 +556,6 @@ _elm_index_efl_ui_widget_theme_apply(Eo *obj, Elm_Index_Data *sd) } 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) { ELM_INDEX_DATA_GET(WIDGET(it), sd); @@ -1937,7 +1926,6 @@ _elm_index_item_efl_access_component_highlight_clear(Eo *eo_it, Elm_Index_Item_D /* 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 e501280..872d89d 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 4be1527..ea380cd 100644 --- a/src/lib/elementary/elm_label.c +++ b/src/lib/elementary/elm_label.c @@ -315,7 +315,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; @@ -848,7 +848,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 2ba3a3b..c1f01b2 100644 --- a/src/lib/elementary/elm_list.c +++ b/src/lib/elementary/elm_list.c @@ -704,7 +704,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; @@ -713,6 +713,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); @@ -849,6 +852,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; @@ -1012,6 +1016,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)); } @@ -1057,6 +1067,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( @@ -3385,7 +3397,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) //TIZEN_ONLY(20171114): list: enhance accessibility scroll and highlight diff --git a/src/lib/elementary/elm_map.c b/src/lib/elementary/elm_map.c index ab6da77..995197b 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 3623ffd..09cab5d 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 * @@ -910,6 +905,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")) @@ -1662,7 +1660,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 87b2427..21fd4d9 100644 --- a/src/lib/elementary/elm_priv.h +++ b/src/lib/elementary/elm_priv.h @@ -1011,8 +1011,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 8676633..3dc7155 100644 --- a/src/lib/elementary/elm_scroller.c +++ b/src/lib/elementary/elm_scroller.c @@ -431,7 +431,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; @@ -1676,7 +1676,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 0a6a3d1..d036b97 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 792a742..4581da0 100644 --- a/src/lib/elementary/elm_separator.c +++ b/src/lib/elementary/elm_separator.c @@ -33,18 +33,6 @@ _elm_separator_efl_ui_widget_theme_apply(Eo *obj, Elm_Separator_Data *sd EINA_UN } 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) { efl_canvas_group_add(efl_super(obj, MY_CLASS)); @@ -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 16f2be4..9ab95cc 100644 --- a/src/lib/elementary/elm_slider.c +++ b/src/lib/elementary/elm_slider.c @@ -969,8 +969,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 @@ -985,7 +986,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 da88874..5ab5e66 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 bd9a1f7..3d35c55 100644 --- a/src/lib/elementary/elm_spinner.c +++ b/src/lib/elementary/elm_spinner.c @@ -1106,20 +1106,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) { @@ -2085,7 +2071,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 0896ce8..b19e9f1 100644 --- a/src/lib/elementary/elm_table.c +++ b/src/lib/elementary/elm_table.c @@ -420,6 +420,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 b849af3..1532041 100644 --- a/src/lib/elementary/elm_toolbar.c +++ b/src/lib/elementary/elm_toolbar.c @@ -4392,6 +4392,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); } diff --git a/src/lib/elementary/elm_widget_layout.h b/src/lib/elementary/elm_widget_layout.h index b7204ad..a254d77 100644 --- a/src/lib/elementary/elm_widget_layout.h +++ b/src/lib/elementary/elm_widget_layout.h @@ -76,6 +76,7 @@ typedef struct _Elm_Layout_Smart_Data Eina_Bool automatic_orientation_apply : 1; Eina_Bool model_bound : 1; /**< Set to true once we are watching over a model*/ Eina_Bool model_watch : 1; /**< Set to true once we do watch for model change*/ + Eina_Bool calc_subobjs : 1; /**< Set to true if group_calc should also handle subobjs during manual calc */ } Efl_Ui_Layout_Data; /** @@ -89,4 +90,6 @@ typedef struct _Elm_Layout_Smart_Data if (EINA_UNLIKELY(!efl_isa(obj, EFL_UI_LAYOUT_BASE_CLASS))) \ return +void _efl_ui_layout_subobjs_calc_set(Eo *obj, Eina_Bool set); + #endif -- 2.7.4