discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=e2d6101851fd695d7343c1194e924065190b6221

commit e2d6101851fd695d7343c1194e924065190b6221
Author: discomfitor <michael.blumenkra...@gmail.com>
Date:   Mon Dec 16 13:34:59 2013 -0500

    bugfix: unset genlist mincalcd flag when changing to/from having no item 
contents
    
    not backporting because not sure if correct, but definitely a bug
    
    also there's a similar issue where objects (I'm looking at you, elm_list) 
don't size until the first render, which causes the initial genlist calc sizes 
to be 100% wrong every time
---
 src/lib/elm_gen_common.h | 1 +
 src/lib/elm_genlist.c    | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/lib/elm_gen_common.h b/src/lib/elm_gen_common.h
index ba22380..19e4a11 100644
--- a/src/lib/elm_gen_common.h
+++ b/src/lib/elm_gen_common.h
@@ -66,6 +66,7 @@ struct Elm_Gen_Item
    Eina_Bool                 reorder : 1;
    Eina_Bool                 decorate_it_set : 1; /**< item uses style mode 
for highlight/select */
    Eina_Bool                 flipped : 1; /**< a flag that shows the flip 
status of the item. */
+   Eina_Bool                 has_contents : 1; /**< content objs have or 
previously did exist (size calcs) */
 };
 
 #endif
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 3fa3aca..3ca50eb 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -1654,6 +1654,9 @@ _item_realize(Elm_Gen_Item *it,
         _item_text_realize(it, VIEW(it), &it->texts, NULL);
         it->content_objs =
           _item_content_realize(it, VIEW(it), &it->contents, NULL);
+        if (it->has_contents != (!!it->content_objs))
+          it->item->mincalcd = EINA_FALSE;
+        it->has_contents = !!it->content_objs;
         _item_state_realize(it, VIEW(it), &it->states, NULL);
         if (it->flipped)
           {
@@ -6485,7 +6488,9 @@ elm_genlist_item_fields_update(Elm_Object_Item *item,
                                                    &it->contents, parts);
         it->content_objs = _item_content_realize(it, VIEW(it),
                                                  &it->contents, parts);
-
+        if (it->has_contents != (!!it->content_objs))
+          it->item->mincalcd = EINA_FALSE;
+        it->has_contents = !!it->content_objs;
         if (it->item->type == ELM_GENLIST_ITEM_NONE)
           {
              Evas_Object* eobj;
@@ -6534,6 +6539,8 @@ elm_genlist_item_fields_update(Elm_Object_Item *item,
 
    if ((!itf) || (itf & ELM_GENLIST_ITEM_FIELD_STATE))
      _item_state_realize(it, VIEW(it), &it->states, parts);
+   if (!it->item->mincalcd)
+     elm_genlist_item_update(item);
 }
 
 EAPI void

-- 


Reply via email to