aboutsummaryrefslogtreecommitdiffstats
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
parenthack and slay position manager (diff)
downloadefl-devs/bu5hm4n/collectionview.tar.gz
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 https://phab.enlightenment.org/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)
if (ITEM_SIZE_FROM_MODEL(model, item_size)) return EINA_FALSE;
- item_size = efl_gfx_hint_size_min_get(entity);
+ //FIXME: size min get returns wrong min values.
+ item_size.w = _elm_config->finger_size;
+ item_size.h = _elm_config->finger_size;
+ item_size = efl_layout_calc_size_min(entity, item_size);
+ //item_size = efl_gfx_hint_size_min_get(entity);
_size_to_model(model, item_size);
return EINA_TRUE;
}
@@ -435,6 +439,7 @@ _cache_size_fetch(Eina_List *requests, Efl_Ui_Collection_Request **request,
Efl_Ui_Collection_Item_Lookup *lookup;
Efl_Model *model;
Eina_Size2D item_size;
+ Eo *entity;
if (!pd->cache) goto not_found;
@@ -445,15 +450,20 @@ _cache_size_fetch(Eina_List *requests, Efl_Ui_Collection_Request **request,
// In the cache we should always have model, so no need to check for it
model = lookup->item.model;
+ entity = lookup->item.entity;
// If we do not know the size
if (!ITEM_SIZE_FROM_MODEL(model, item_size))
{
// But can calculate it now
- if (!lookup->item.entity) goto not_found;
-
- item_size = efl_gfx_hint_size_min_get(lookup->item.entity);
-// printf("%lu %p %s-%s\n", search_index,lookup->item.entity, efl_text_get(lookup->item.entity), efl_class_name_get(lookup->item.entity));
+ if (!entity) goto not_found;
+
+ //FIXME: size min get returns wrong min values.
+ item_size.w = _elm_config->finger_size;
+ item_size.h = _elm_config->finger_size;
+ item_size = efl_layout_calc_size_min(entity, item_size);
+ //item_size = efl_gfx_hint_size_min_get(entity);
+// printf("%lu %p %s-%s\n", search_index, entity, efl_text_get(entity), efl_class_name_get(entity));
item_size.w = MAX(item_size.w, 10);
item_size.h = MAX(item_size.h, 10);
_size_to_model(model, item_size);
@@ -707,7 +717,7 @@ _batch_size_cb(void *data, int start_id, Eina_Rw_Slice memory)
Efl_Gfx_Entity *entity = pd->viewport[i]->items[offset].entity;
Eina_Bool entity_request = EINA_FALSE;
- if (!model)
+ if (model)
{
Eina_Size2D item_size;
Eina_Bool found = EINA_FALSE;
@@ -716,7 +726,11 @@ _batch_size_cb(void *data, int start_id, Eina_Rw_Slice memory)
found = EINA_TRUE;
if (!found && entity)
{
- item_size = efl_gfx_hint_size_min_get(entity);
+ //FIXME: size min get returns wrong min values.
+ item_size.w = _elm_config->finger_size;
+ item_size.h = _elm_config->finger_size;
+ item_size = efl_layout_calc_size_min(entity, item_size);
+ //item_size = efl_gfx_hint_size_min_get(entity);
_size_to_model(model, item_size);
found = EINA_TRUE;
}