jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=60566ca34d0036d21e5d134ba299b6f0fa26ce86

commit 60566ca34d0036d21e5d134ba299b6f0fa26ce86
Author: Jeeyong Um <[email protected]>
Date:   Fri Mar 10 14:59:47 2017 +0900

    Genlist: Calculate the min size of content before item realize
    
    Summary:
    Genlist item doesn't change its size when its content size is changed,
    but its size is determined in realization.
    Therefore, deferred calculations for content should be performed immediately
    before swallowing it by genlist item.
    
    Test Plan: make and run attached sample
    
    Reviewers: cedric, SanghyeonLee, jpeg
    
    Reviewed By: jpeg
    
    Differential Revision: https://phab.enlightenment.org/D4705
---
 src/lib/elementary/elm_genlist.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 3197500..aa049c8 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -412,16 +412,17 @@ _item_content_realize(Elm_Gen_Item *it,
              // FIXME: cause elm_layout sizing eval is delayed by smart calc,
              // genlist cannot get actual min size of edje.
              // This is workaround code to set min size directly.
-             if (efl_class_get(content) == ELM_LAYOUT_CLASS)
+             Evas_Object *resize_obj = NULL;
+             if (efl_isa(content, ELM_WIDGET_CLASS))
                {
-                  Evas_Coord old_w, old_h, minw = 0, minh = 0;
-                  efl_gfx_size_hint_combined_min_get(content, &old_w, &old_h);
-                  edje_object_size_min_calc(elm_layout_edje_get(content), 
&minw, &minh);
-
-                  if (old_w > minw) minw = old_w;
-                  if (old_h > minh) minw = old_h;
-                  evas_object_size_hint_min_set(content, minw, minh);
+                  ELM_WIDGET_DATA_GET_OR_RETURN(content, wd);
+                  resize_obj = wd->resize_obj;
                }
+             else if (efl_isa(content, EFL_CANVAS_GROUP_CLASS))
+               resize_obj = content;
+
+             if (resize_obj && 
efl_canvas_group_need_recalculate_get(resize_obj))
+               efl_canvas_group_calculate(content);
 
              if (!edje_object_part_swallow(target, key, content))
                {

-- 


Reply via email to