summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>2019-08-26 08:33:19 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-08-26 08:33:19 -0400
commit1255512b40c892b4b5b145cc0cafb19c192776cc (patch)
tree8637880dcbd57ab5ab801d6fe8ef1c8902325c90
parent6a1a0eb88008e40b2a449f69744d5ed44587c902 (diff)
elementary: fix the size calculation on the collection view.devs/bu5hm4n/collectionview
Summary: fixing size calculation errors in the collection view. edje object need to be restricted calculation for giving min size properly. by calling efl_layout_calc_size_min() instead of efl_gfx_hint_size_min_get() get proper minimum size of item based on restricted finger size. Depends on D9741 Reviewers: cedric, bu5hm4n, felipealmeida, lauromoura, zmike Reviewed By: zmike Subscribers: zmike Tags: #efl_widgets Differential Revision: https://phab.enlightenment.org/D9742
-rw-r--r--src/lib/elementary/efl_ui_collection_view.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/lib/elementary/efl_ui_collection_view.c b/src/lib/elementary/efl_ui_collection_view.c
index 2aa73852f7..ae8caebcb9 100644
--- a/src/lib/elementary/efl_ui_collection_view.c
+++ b/src/lib/elementary/efl_ui_collection_view.c
@@ -323,7 +323,11 @@ _entity_propagate(Efl_Model *model, Efl_Gfx_Entity *entity)
323 323
324 if (ITEM_SIZE_FROM_MODEL(model, item_size)) return EINA_FALSE; 324 if (ITEM_SIZE_FROM_MODEL(model, item_size)) return EINA_FALSE;
325 325
326 item_size = efl_gfx_hint_size_min_get(entity); 326 //FIXME: size min get returns wrong min values.
327 item_size.w = _elm_config->finger_size;
328 item_size.h = _elm_config->finger_size;
329 item_size = efl_layout_calc_size_min(entity, item_size);
330 //item_size = efl_gfx_hint_size_min_get(entity);
327 _size_to_model(model, item_size); 331 _size_to_model(model, item_size);
328 return EINA_TRUE; 332 return EINA_TRUE;
329} 333}
@@ -435,6 +439,7 @@ _cache_size_fetch(Eina_List *requests, Efl_Ui_Collection_Request **request,
435 Efl_Ui_Collection_Item_Lookup *lookup; 439 Efl_Ui_Collection_Item_Lookup *lookup;
436 Efl_Model *model; 440 Efl_Model *model;
437 Eina_Size2D item_size; 441 Eina_Size2D item_size;
442 Eo *entity;
438 443
439 if (!pd->cache) goto not_found; 444 if (!pd->cache) goto not_found;
440 445
@@ -445,15 +450,20 @@ _cache_size_fetch(Eina_List *requests, Efl_Ui_Collection_Request **request,
445 450
446 // In the cache we should always have model, so no need to check for it 451 // In the cache we should always have model, so no need to check for it
447 model = lookup->item.model; 452 model = lookup->item.model;
453 entity = lookup->item.entity;
448 454
449 // If we do not know the size 455 // If we do not know the size
450 if (!ITEM_SIZE_FROM_MODEL(model, item_size)) 456 if (!ITEM_SIZE_FROM_MODEL(model, item_size))
451 { 457 {
452 // But can calculate it now 458 // But can calculate it now
453 if (!lookup->item.entity) goto not_found; 459 if (!entity) goto not_found;
454 460
455 item_size = efl_gfx_hint_size_min_get(lookup->item.entity); 461 //FIXME: size min get returns wrong min values.
456// printf("%lu %p %s-%s\n", search_index,lookup->item.entity, efl_text_get(lookup->item.entity), efl_class_name_get(lookup->item.entity)); 462 item_size.w = _elm_config->finger_size;
463 item_size.h = _elm_config->finger_size;
464 item_size = efl_layout_calc_size_min(entity, item_size);
465 //item_size = efl_gfx_hint_size_min_get(entity);
466// printf("%lu %p %s-%s\n", search_index, entity, efl_text_get(entity), efl_class_name_get(entity));
457 item_size.w = MAX(item_size.w, 10); 467 item_size.w = MAX(item_size.w, 10);
458 item_size.h = MAX(item_size.h, 10); 468 item_size.h = MAX(item_size.h, 10);
459 _size_to_model(model, item_size); 469 _size_to_model(model, item_size);
@@ -707,7 +717,7 @@ _batch_size_cb(void *data, int start_id, Eina_Rw_Slice memory)
707 Efl_Gfx_Entity *entity = pd->viewport[i]->items[offset].entity; 717 Efl_Gfx_Entity *entity = pd->viewport[i]->items[offset].entity;
708 Eina_Bool entity_request = EINA_FALSE; 718 Eina_Bool entity_request = EINA_FALSE;
709 719
710 if (!model) 720 if (model)
711 { 721 {
712 Eina_Size2D item_size; 722 Eina_Size2D item_size;
713 Eina_Bool found = EINA_FALSE; 723 Eina_Bool found = EINA_FALSE;
@@ -716,7 +726,11 @@ _batch_size_cb(void *data, int start_id, Eina_Rw_Slice memory)
716 found = EINA_TRUE; 726 found = EINA_TRUE;
717 if (!found && entity) 727 if (!found && entity)
718 { 728 {
719 item_size = efl_gfx_hint_size_min_get(entity); 729 //FIXME: size min get returns wrong min values.
730 item_size.w = _elm_config->finger_size;
731 item_size.h = _elm_config->finger_size;
732 item_size = efl_layout_calc_size_min(entity, item_size);
733 //item_size = efl_gfx_hint_size_min_get(entity);
720 _size_to_model(model, item_size); 734 _size_to_model(model, item_size);
721 found = EINA_TRUE; 735 found = EINA_TRUE;
722 } 736 }