efl_ui_table: update recalc boolean in child delete callback
authorYeongjong Lee <yj34.lee@samsung.com>
Fri, 6 Sep 2019 07:20:13 +0000 (09:20 +0200)
committerYeongjong Lee <yj34.lee@samsung.com>
Mon, 16 Sep 2019 01:23:00 +0000 (10:23 +0900)
Test Plan:
1. elementary_test -to 'efl.ui.table (linear api)'
2. Click `Append` button 3 times.
3. Click `appended 6` button to delete
4. Click `Append` button.
5. Check that `appended 7` button position (1,1).

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9856

src/lib/elementary/efl_ui_table.c

index 6412b07..13b3c4b 100644 (file)
@@ -58,6 +58,14 @@ _on_child_del(void *data, const Efl_Event *event)
    gi = _efl_ui_table_item_date_get(table, pd, event->object);
    if (!gi) return;
 
+   if ((gi->col == pd->last_col) && (gi->row == pd->last_row))
+     pd->linear_recalc = EINA_TRUE;
+
+   if (gi->col + gi->col_span >= pd->cols)
+     pd->cols_recalc = EINA_TRUE;
+   if (gi->row + gi->row_span >= pd->rows)
+     pd->rows_recalc = EINA_TRUE;
+
    pd->items = (Table_Item *)
          eina_inlist_remove(EINA_INLIST_GET(pd->items), EINA_INLIST_GET(gi));
    free(gi);