bugfix: unset genlist mincalcd flag when changing to/from having no item contents
authordiscomfitor <michael.blumenkrantz@gmail.com>
Mon, 16 Dec 2013 18:34:59 +0000 (13:34 -0500)
committerdiscomfitor <michael.blumenkrantz@gmail.com>
Mon, 16 Dec 2013 19:15:29 +0000 (14:15 -0500)
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

legacy/elementary/src/lib/elm_gen_common.h
legacy/elementary/src/lib/elm_genlist.c

index ba22380..19e4a11 100644 (file)
@@ -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
index 3fa3aca..3ca50eb 100644 (file)
@@ -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