summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeeyong Um <conr2d@gmail.com>2017-03-10 14:59:47 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-03-10 14:59:48 +0900
commit60566ca34d0036d21e5d134ba299b6f0fa26ce86 (patch)
tree15ca2c7453c9d4b995226e3e54ec469a15cf820c
parentfc40d3d5594fcce2b02876e0d9c63ca27644bf64 (diff)
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
-rw-r--r--src/lib/elementary/elm_genlist.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 3197500492..aa049c898f 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,
412 // FIXME: cause elm_layout sizing eval is delayed by smart calc, 412 // FIXME: cause elm_layout sizing eval is delayed by smart calc,
413 // genlist cannot get actual min size of edje. 413 // genlist cannot get actual min size of edje.
414 // This is workaround code to set min size directly. 414 // This is workaround code to set min size directly.
415 if (efl_class_get(content) == ELM_LAYOUT_CLASS) 415 Evas_Object *resize_obj = NULL;
416 if (efl_isa(content, ELM_WIDGET_CLASS))
416 { 417 {
417 Evas_Coord old_w, old_h, minw = 0, minh = 0; 418 ELM_WIDGET_DATA_GET_OR_RETURN(content, wd);
418 efl_gfx_size_hint_combined_min_get(content, &old_w, &old_h); 419 resize_obj = wd->resize_obj;
419 edje_object_size_min_calc(elm_layout_edje_get(content), &minw, &minh);
420
421 if (old_w > minw) minw = old_w;
422 if (old_h > minh) minw = old_h;
423 evas_object_size_hint_min_set(content, minw, minh);
424 } 420 }
421 else if (efl_isa(content, EFL_CANVAS_GROUP_CLASS))
422 resize_obj = content;
423
424 if (resize_obj && efl_canvas_group_need_recalculate_get(resize_obj))
425 efl_canvas_group_calculate(content);
425 426
426 if (!edje_object_part_swallow(target, key, content)) 427 if (!edje_object_part_swallow(target, key, content))
427 { 428 {