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
This commit is contained in:
discomfitor 2013-12-16 13:34:59 -05:00
parent 1cad3a5d34
commit ba5823f188
2 changed files with 9 additions and 1 deletions

View 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

View 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