summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarry Jr <larry.olj@gmail.com>2017-10-26 13:59:31 -0200
committerSangHyeon Jade Lee <dltkdgus1764@gmail.com>2017-11-15 17:06:45 +0900
commit95ce6df7f5e6aa4969c2054682f0ec1fa06a450d (patch)
tree1e12d1fc7801a37f4a4902384c0f27b133dc9007
parenta26fd313567f52d72f2418e96ae8fc8d3f0d8c4e (diff)
elm: fix changed size hints callback add in efl_ui_list_precise_layout
-rw-r--r--src/lib/elementary/efl_ui_list.c28
-rw-r--r--src/lib/elementary/efl_ui_list_precise_layouter.c17
2 files changed, 7 insertions, 38 deletions
diff --git a/src/lib/elementary/efl_ui_list.c b/src/lib/elementary/efl_ui_list.c
index 7075ef9..239bd13 100644
--- a/src/lib/elementary/efl_ui_list.c
+++ b/src/lib/elementary/efl_ui_list.c
@@ -900,7 +900,6 @@ _efl_ui_list_efl_gfx_size_set(Eo *obj, Efl_Ui_List_Data *pd, Eina_Size2D size)
900 Eina_Bool load = EINA_FALSE; 900 Eina_Bool load = EINA_FALSE;
901 901
902 DBG("w: %d h: %d", size.w, size.h); 902 DBG("w: %d h: %d", size.w, size.h);
903
904 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, size.w, size.h)) 903 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, size.w, size.h))
905 return; 904 return;
906 905
@@ -1432,29 +1431,6 @@ _efl_ui_list_item_select_set(Efl_Ui_List_Item *item, Eina_Bool selected)
1432 /* efl_event_callback_legacy_call(item->layout, EFL_UI_EVENT_UNSELECTED, item); */ 1431 /* efl_event_callback_legacy_call(item->layout, EFL_UI_EVENT_UNSELECTED, item); */
1433} 1432}
1434 1433
1435/* static void */
1436/* _item_calc(Efl_Ui_List_Data *pd, Efl_Ui_List_Item *item) */
1437/* { */
1438/* int pad[4]; */
1439/* Eina_Size2D min; */
1440
1441/* min = efl_gfx_size_hint_combined_min_get(item->layout); */
1442/* efl_gfx_size_hint_margin_get(item->layout, &pad[0], &pad[1], &pad[2], &pad[3]); */
1443/* efl_gfx_size_hint_weight_get(item->layout, &item->wx, &item->wy); */
1444
1445/* if (item->wx < 0) item->wx = 0; */
1446/* if (item->wy < 0) item->wy = 0; */
1447
1448/* min.w += pad[0] + pad[1]; */
1449/* min.h += pad[2] + pad[3]; */
1450
1451/* pd->weight.x += item->wx; */
1452/* pd->weight.y += item->wy; */
1453
1454/* _item_min_calc(pd, item, min.h, min.w); */
1455/* evas_object_size_hint_min_set(item->layout, min.w, min.h); */
1456/* } */
1457
1458static void 1434static void
1459_efl_ui_list_relayout_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd EINA_UNUSED, Efl_Ui_List_Relayout *object) 1435_efl_ui_list_relayout_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd EINA_UNUSED, Efl_Ui_List_Relayout *object)
1460{ 1436{
@@ -1505,11 +1481,9 @@ _efl_ui_list_efl_ui_list_model_min_size_set(Eo *obj, Efl_Ui_List_Data *pd, Eina_
1505 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 1481 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1506 1482
1507 pd->min.w = min.w; 1483 pd->min.w = min.w;
1508 pd->min.h = min.h;// + 200; 1484 pd->min.h = min.h;
1509 1485
1510 evas_object_size_hint_min_set(wd->resize_obj, pd->min.w, pd->min.h); 1486 evas_object_size_hint_min_set(wd->resize_obj, pd->min.w, pd->min.h);
1511 DBG("min_size_set w:%d h:%d", pd->min.w, pd->min.h);
1512
1513 efl_event_callback_legacy_call(pd->pan_obj, ELM_PAN_EVENT_CHANGED, NULL); 1487 efl_event_callback_legacy_call(pd->pan_obj, ELM_PAN_EVENT_CHANGED, NULL);
1514} 1488}
1515 1489
diff --git a/src/lib/elementary/efl_ui_list_precise_layouter.c b/src/lib/elementary/efl_ui_list_precise_layouter.c
index e36e851..1c7da2f 100644
--- a/src/lib/elementary/efl_ui_list_precise_layouter.c
+++ b/src/lib/elementary/efl_ui_list_precise_layouter.c
@@ -216,25 +216,20 @@ _efl_ui_list_precise_layouter_efl_ui_list_relayout_layout_do
216 /* // error */ 216 /* // error */
217 /* continue; */ 217 /* continue; */
218 /* } */ 218 /* } */
219 }
219 220
220 size = calloc(1, sizeof(Efl_Ui_List_Precise_Layouter_Size)); 221 size = calloc(1, sizeof(Efl_Ui_List_Precise_Layouter_Size));
222 eina_hash_add(pd->size_information, &layout_item, size);
221 Eina_Size2D min = efl_gfx_size_hint_combined_min_get(layout_item->layout); 223 Eina_Size2D min = efl_gfx_size_hint_combined_min_get(layout_item->layout);
222 if(min.w && min.h) 224 if(min.w && min.h)
223 { 225 {
224// DBG("size was calculated"); 226// DBG("size was calculated");
225 Efl_Ui_List_Precise_Layouter_Callback_Data *cb_data = calloc(1, sizeof(Efl_Ui_List_Precise_Layouter_Callback_Data));
226 _item_min_calc(pd, layout_item->layout, size, min); 227 _item_min_calc(pd, layout_item->layout, size, min);
227 eina_hash_add(pd->size_information, &layout_item, size);
228 cb_data->pd = pd;
229 cb_data->size = size;
230 evas_object_event_callback_add(layout_item->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_item_size_hint_change, cb_data);
231 }
232 else
233 {
234// DBG("size was NOT calculated, not loaded yet probably");
235 free(size);
236 }
237 } 228 }
229 Efl_Ui_List_Precise_Layouter_Callback_Data *cb_data = calloc(1, sizeof(Efl_Ui_List_Precise_Layouter_Callback_Data));
230 cb_data->pd = pd;
231 cb_data->size = size;
232 evas_object_event_callback_add(layout_item->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_item_size_hint_change, cb_data);
238 } 233 }
239 } 234 }
240 235