Summary:
When gengrid item is reordered or deleted, gengrid didn't update item's position.
This Patch update item's position when item is placed. if middle of item deleted,
every item after the deleted one, will re-postion on _item_place function, so they
will be update there position well.
Test Plan:
modify test_gengrid grid_sel fuction to print there position. so when item selected,
they print there position and it works fine both horizontal and vertical.
Reviewers: bluezery, seoz, raster
Reviewed By: raster
CC: Hermet, chinmaya061
Differential Revision: https://phab.enlightenment.org/D855
static void
grid_sel(void *data, Evas_Object *obj, void *event_info)
{
- printf("sel item data [%p] on grid obj [%p], pointer [%p]\n", data, obj, event_info);
+ printf("sel item data [%p] on grid obj [%p], pointer [%p], position [%d]\n", data, obj, event_info, elm_gengrid_item_index_get(event_info));
}
static void
Eina_Bool was_realized;
Elm_Gen_Item_Type *item;
long items_count;
+ int item_pos;
item = GG_IT(it);
wsd = GG_IT(it)->wsd;
else
tch = items_row * wsd->item_height;
alignh = (vh - tch) * wsd->align_y;
+ item_pos = items_row * cx + cy + 1;
+ if (item_pos != it->position)
+ {
+ it->position = item_pos;
+ it->position_update = EINA_TRUE;
+ }
}
else
{
else
tcw = items_col * wsd->item_width;
alignw = (vw - tcw) * wsd->align_x;
+ item_pos = cx + items_col * cy + 1;
+ if (item_pos != it->position)
+ {
+ it->position = item_pos;
+ it->position_update = EINA_TRUE;
+ }
}
if (it->group)