ui: fields selection clean up less blocky.

Need to clean up these objects but do it in chunks...
This commit is contained in:
Alastair Poole 2021-03-13 06:53:42 +00:00
parent 01718b1cdf
commit 9158d0a8ee
2 changed files with 32 additions and 19 deletions

View File

@ -63,23 +63,6 @@ evisum_ui_item_cache_steal(Evisum_Ui_Cache *cache, Eina_List *objs)
}
}
static Eina_Bool
_pending_triggered_cb(void *data)
{
Eina_List *l, *l_next;
Evas_Object *o;
Evisum_Ui_Cache *cache = data;
EINA_LIST_FOREACH_SAFE(cache->pending, l, l_next, o)
{
cache->pending = eina_list_remove_list(cache->pending, l);
evas_object_del(o);
}
cache->pending_timer = NULL;
return 0;
}
Item_Cache *
evisum_ui_item_cache_item_get(Evisum_Ui_Cache *cache)
{
@ -129,6 +112,36 @@ evisum_ui_item_cache_reset(Evisum_Ui_Cache *cache)
}
}
// Delete N at a time and pass on until empty.
static Eina_Bool
_pending_triggered_cb(void *data)
{
Eina_List *l, *l_next;
Evas_Object *o;
Evisum_Ui_Cache *cache;
int n, i = 0;
cache = data;
n = eina_list_count(cache->pending);
EINA_LIST_FOREACH_SAFE(cache->pending, l, l_next, o)
{
cache->pending = eina_list_remove_list(cache->pending, l);
evas_object_del(o);
i++; n--;
if (i == 20) break;
}
if (n)
return 1;
#if 0
puts("GONE");
#endif
cache->pending_timer = NULL;
return 0;
}
void
evisum_ui_item_cache_pending_del(Evisum_Ui_Cache *cache)
{

View File

@ -182,6 +182,7 @@ _content_reset(Data *pd)
elm_genlist_clear(pd->glist);
if (pd->cache)
evisum_ui_item_cache_reset(pd->cache);
evisum_ui_item_cache_pending_del(pd->cache);
}
static void
@ -859,7 +860,7 @@ _process_list_search_trim(Eina_List *list, Data *pd)
EINA_LIST_FOREACH_SAFE(list, l, l_next, proc)
{
if (_process_ignore(pd, proc))
if (_process_ignore(pd, proc))
{
proc_info_free(proc);
list = eina_list_remove_list(list, l);
@ -1036,7 +1037,6 @@ _btn_clicked_state_save(Data *pd, Evas_Object *btn)
if (pd->fields_menu)
{
evisum_ui_item_cache_pending_del(pd->cache);
evas_object_del(pd->fields_menu);
pd->fields_menu = NULL;
return;