forked from enlightenment/efl
index: internal item's edje object handling logic changed to improve performance.
Summary: The box_clear, box_fill internal functions called when almost every internal chage happend. (resize, theme apply, item append, item delete etc...) Then those APIs delete/create item's edje object for all of the items. It's very not good action for performance. So, i changed this just edje object box unpack/pack instead of delete/create. @fix Test Plan: Working test on elementary_test and Call all of the index APIs for check this change. Reviewers: Hermet, cedric Reviewed By: cedric Differential Revision: https://phab.enlightenment.org/D3268 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
6bfe82cc77
commit
41bfc98606
|
@ -76,7 +76,8 @@ _index_box_clear(Evas_Object *obj,
|
|||
{
|
||||
ELM_INDEX_ITEM_DATA_GET(eo_item, it);
|
||||
if (it->level != level) continue;
|
||||
ELM_SAFE_FREE(VIEW(it), evas_object_del);
|
||||
evas_object_box_remove(sd->bx[level], VIEW(it));
|
||||
evas_object_hide(VIEW(it));
|
||||
}
|
||||
|
||||
sd->level_active[level] = EINA_FALSE;
|
||||
|
@ -314,9 +315,8 @@ _index_box_auto_fill(Evas_Object *obj,
|
|||
continue;
|
||||
}
|
||||
|
||||
o = edje_object_add(evas_object_evas_get(obj));
|
||||
VIEW(it) = o;
|
||||
edje_object_mirrored_set(VIEW(it), rtl);
|
||||
o = VIEW(it);
|
||||
|
||||
if (sd->horizontal)
|
||||
{
|
||||
|
@ -637,7 +637,7 @@ _sel_eval(Evas_Object *obj,
|
|||
it_last = it;
|
||||
it->selected = EINA_FALSE;
|
||||
}
|
||||
if (VIEW(it))
|
||||
if (evas_object_visible_get(VIEW(it)))
|
||||
{
|
||||
evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
|
||||
xx = x + (w / 2);
|
||||
|
@ -1359,29 +1359,33 @@ _elm_index_selected_item_get(const Eo *obj EINA_UNUSED, Elm_Index_Data *sd, int
|
|||
EOLIAN static Elm_Object_Item*
|
||||
_elm_index_item_append(Eo *obj, Elm_Index_Data *sd, const char *letter, Evas_Smart_Cb func, const void *data)
|
||||
{
|
||||
Elm_Object_Item *it;
|
||||
Elm_Object_Item *eo_item;
|
||||
|
||||
it = _item_new(obj, letter, func, data);
|
||||
if (!it) return NULL;
|
||||
eo_item = _item_new(obj, letter, func, data);
|
||||
if (!eo_item) return NULL;
|
||||
|
||||
sd->items = eina_list_append(sd->items, it);
|
||||
_index_box_clear(obj, sd->level);
|
||||
sd->items = eina_list_append(sd->items, eo_item);
|
||||
|
||||
return it;
|
||||
ELM_INDEX_ITEM_DATA_GET(eo_item, it);
|
||||
VIEW(it) = edje_object_add(evas_object_evas_get(obj));
|
||||
|
||||
return eo_item;
|
||||
}
|
||||
|
||||
EOLIAN static Elm_Object_Item*
|
||||
_elm_index_item_prepend(Eo *obj, Elm_Index_Data *sd, const char *letter, Evas_Smart_Cb func, const void *data)
|
||||
{
|
||||
Elm_Object_Item *it;
|
||||
Elm_Object_Item *eo_item;
|
||||
|
||||
it = _item_new(obj, letter, func, data);
|
||||
if (!it) return NULL;
|
||||
eo_item = _item_new(obj, letter, func, data);
|
||||
if (!eo_item) return NULL;
|
||||
|
||||
sd->items = eina_list_prepend(sd->items, it);
|
||||
_index_box_clear(obj, sd->level);
|
||||
sd->items = eina_list_prepend(sd->items, eo_item);
|
||||
|
||||
return it;
|
||||
ELM_INDEX_ITEM_DATA_GET(eo_item, it);
|
||||
VIEW(it) = edje_object_add(evas_object_evas_get(obj));
|
||||
|
||||
return eo_item;
|
||||
}
|
||||
|
||||
EINA_DEPRECATED EAPI Elm_Object_Item *
|
||||
|
@ -1397,34 +1401,38 @@ elm_index_item_prepend_relative(Evas_Object *obj,
|
|||
EOLIAN static Elm_Object_Item*
|
||||
_elm_index_item_insert_after(Eo *obj, Elm_Index_Data *sd, Elm_Object_Item *after, const char *letter, Evas_Smart_Cb func, const void *data)
|
||||
{
|
||||
Elm_Object_Item *it;
|
||||
Elm_Object_Item *eo_item;
|
||||
|
||||
|
||||
if (!after) return elm_index_item_append(obj, letter, func, data);
|
||||
|
||||
it = _item_new(obj, letter, func, data);
|
||||
if (!it) return NULL;
|
||||
eo_item = _item_new(obj, letter, func, data);
|
||||
if (!eo_item) return NULL;
|
||||
|
||||
sd->items = eina_list_append_relative(sd->items, it, after);
|
||||
_index_box_clear(obj, sd->level);
|
||||
sd->items = eina_list_append_relative(sd->items, eo_item, after);
|
||||
|
||||
return it;
|
||||
ELM_INDEX_ITEM_DATA_GET(eo_item, it);
|
||||
VIEW(it) = edje_object_add(evas_object_evas_get(obj));
|
||||
|
||||
return eo_item;
|
||||
}
|
||||
|
||||
EOLIAN static Elm_Object_Item*
|
||||
_elm_index_item_insert_before(Eo *obj, Elm_Index_Data *sd, Elm_Object_Item *before, const char *letter, Evas_Smart_Cb func, const void *data)
|
||||
{
|
||||
Elm_Object_Item *it;
|
||||
Elm_Object_Item *eo_item;
|
||||
|
||||
if (!before) return elm_index_item_prepend(obj, letter, func, data);
|
||||
|
||||
it = _item_new(obj, letter, func, data);
|
||||
if (!it) return NULL;
|
||||
eo_item = _item_new(obj, letter, func, data);
|
||||
if (!eo_item) return NULL;
|
||||
|
||||
sd->items = eina_list_prepend_relative(sd->items, it, before);
|
||||
_index_box_clear(obj, sd->level);
|
||||
sd->items = eina_list_prepend_relative(sd->items, eo_item, before);
|
||||
|
||||
return it;
|
||||
ELM_INDEX_ITEM_DATA_GET(eo_item, it);
|
||||
VIEW(it) = edje_object_add(evas_object_evas_get(obj));
|
||||
|
||||
return eo_item;
|
||||
}
|
||||
|
||||
EOLIAN static Elm_Object_Item*
|
||||
|
@ -1459,7 +1467,8 @@ _elm_index_item_sorted_insert(Eo *obj, Elm_Index_Data *sd, const char *letter, E
|
|||
eo_item = NULL;
|
||||
}
|
||||
}
|
||||
_index_box_clear(obj, sd->level);
|
||||
ELM_INDEX_ITEM_DATA_GET(eo_item, it);
|
||||
VIEW(it) = edje_object_add(evas_object_evas_get(obj));
|
||||
|
||||
if (!eo_item) return NULL;
|
||||
else return eo_item;
|
||||
|
|
Loading…
Reference in New Issue