summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2015-09-01 20:08:42 +0200
committerDave Andreoli <dave@gurumeditation.it>2015-09-01 20:08:42 +0200
commit7217133861bc380e63475f5756663cb462d1d94b (patch)
treeb876e511926725cfe2aeab60dec8a1e6391e4ee2
parent624e0b1209cf8767573aadccb6e61c685ca1bdb4 (diff)
Genlist: add homogeneos mode to the tree test
show tree+homogeneous brackage, as explained in T2708
-rw-r--r--src/bin/test_genlist.c63
1 files changed, 38 insertions, 25 deletions
diff --git a/src/bin/test_genlist.c b/src/bin/test_genlist.c
index a4ff09607..e32c58b8b 100644
--- a/src/bin/test_genlist.c
+++ b/src/bin/test_genlist.c
@@ -1343,7 +1343,7 @@ gl4_exp(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
1343 int i = 0; 1343 int i = 0;
1344 1344
1345 val *= 10; 1345 val *= 10;
1346 for (i = 0; i < 10; i++) 1346 for (i = 0; i < 30; i++)
1347 { 1347 {
1348 elm_genlist_item_append(gl, api->itc2, 1348 elm_genlist_item_append(gl, api->itc2,
1349 (void *)(uintptr_t) (val + i)/* item data */, 1349 (void *)(uintptr_t) (val + i)/* item data */,
@@ -1430,21 +1430,21 @@ gl4_del(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
1430} 1430}
1431 1431
1432static void 1432static void
1433_tree_effect_enable_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 1433_tree_effect_changed_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
1434{ 1434{
1435 elm_genlist_tree_effect_enabled_set(data, EINA_TRUE); 1435 elm_genlist_tree_effect_enabled_set(data, elm_check_state_get(obj));
1436} 1436}
1437 1437
1438static void 1438static void
1439_tree_effect_disable_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 1439_tree_homogeneous_changed_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
1440{ 1440{
1441 elm_genlist_tree_effect_enabled_set(data, EINA_FALSE); 1441 elm_genlist_homogeneous_set(data, elm_check_state_get(obj));
1442} 1442}
1443 1443
1444void 1444void
1445test_genlist6(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 1445test_genlist6(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
1446{ 1446{
1447 Evas_Object *win, *gl, *bx, *fr, *bx2, *rd1, *rd2; 1447 Evas_Object *win, *gl, *bx, *fr, *bx2, *ck1, *ck2;
1448 1448
1449 api_data *api = calloc(1, sizeof(api_data)); 1449 api_data *api = calloc(1, sizeof(api_data));
1450 win = elm_win_util_standard_add("genlist-tree", "Genlist Tree"); 1450 win = elm_win_util_standard_add("genlist-tree", "Genlist Tree");
@@ -1457,7 +1457,9 @@ test_genlist6(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1457 evas_object_show(bx); 1457 evas_object_show(bx);
1458 1458
1459 fr = elm_frame_add(win); 1459 fr = elm_frame_add(win);
1460 elm_object_text_set(fr, "Genlist Tree Effect"); 1460 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
1461 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, 0.0);
1462 elm_object_text_set(fr, "Genlist Tree Options");
1461 elm_box_pack_end(bx, fr); 1463 elm_box_pack_end(bx, fr);
1462 evas_object_show(fr); 1464 evas_object_show(fr);
1463 1465
@@ -1469,25 +1471,21 @@ test_genlist6(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1469 elm_object_content_set(fr, bx2); 1471 elm_object_content_set(fr, bx2);
1470 evas_object_show(bx2); 1472 evas_object_show(bx2);
1471 1473
1472 rd1 = elm_radio_add(win); 1474 ck1 = elm_check_add(win);
1473 elm_radio_state_value_set(rd1, 0); 1475 elm_object_text_set(ck1, "Tree Effect");
1474 elm_object_text_set(rd1, "Enable "); 1476 evas_object_show(ck1);
1475 evas_object_show(rd1); 1477 elm_box_pack_end(bx2, ck1);
1476 elm_box_pack_end(bx2, rd1);
1477 1478
1478 rd2 = elm_radio_add(win); 1479 ck2 = elm_check_add(win);
1479 elm_radio_state_value_set(rd2, 1); 1480 elm_object_text_set(ck2, "Homogeneous");
1480 elm_radio_group_add(rd1, rd2); 1481 evas_object_show(ck2);
1481 elm_object_text_set(rd2, "Disable"); 1482 elm_box_pack_end(bx2, ck2);
1482 evas_object_show(rd2);
1483 elm_box_pack_end(bx2, rd2);
1484 1483
1485 gl = elm_genlist_add(win); 1484 gl = elm_genlist_add(win);
1486 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); 1485 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
1487 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1486 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1488 api->gl = gl; 1487 api->gl = gl;
1489 evas_object_show(gl); 1488 evas_object_show(gl);
1490 elm_genlist_tree_effect_enabled_set(gl, EINA_TRUE);
1491 evas_object_smart_callback_add(gl, "edge,left", scroll_left, NULL); 1489 evas_object_smart_callback_add(gl, "edge,left", scroll_left, NULL);
1492 evas_object_smart_callback_add(gl, "edge,right", scroll_right, NULL); 1490 evas_object_smart_callback_add(gl, "edge,right", scroll_right, NULL);
1493 evas_object_smart_callback_add(gl, "edge,top", scroll_top, NULL); 1491 evas_object_smart_callback_add(gl, "edge,top", scroll_top, NULL);
@@ -1508,13 +1506,16 @@ test_genlist6(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1508 api->itc2->func.del = gl4_del; 1506 api->itc2->func.del = gl4_del;
1509 1507
1510 elm_genlist_item_append(gl, api->itc2, 1508 elm_genlist_item_append(gl, api->itc2,
1511 (void *)1/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */, 1509 (void *)1/* item data */, NULL/* parent */,
1510 ELM_GENLIST_ITEM_TREE, gl4_sel/* func */,
1512 NULL/* func data */); 1511 NULL/* func data */);
1513 elm_genlist_item_append(gl, api->itc2, 1512 elm_genlist_item_append(gl, api->itc2,
1514 (void *)2/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */, 1513 (void *)2/* item data */, NULL/* parent */,
1514 ELM_GENLIST_ITEM_TREE, gl4_sel/* func */,
1515 NULL/* func data */); 1515 NULL/* func data */);
1516 elm_genlist_item_append(gl, api->itc1, 1516 elm_genlist_item_append(gl, api->itc1,
1517 (void *)3/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, 1517 (void *)3/* item data */, NULL/* parent */,
1518 ELM_GENLIST_ITEM_NONE, gl4_sel/* func */,
1518 NULL/* func data */); 1519 NULL/* func data */);
1519 1520
1520 elm_genlist_item_class_free(api->itc1); 1521 elm_genlist_item_class_free(api->itc1);
@@ -1525,10 +1526,10 @@ test_genlist6(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
1525 evas_object_smart_callback_add(gl, "expanded", gl4_exp, api); 1526 evas_object_smart_callback_add(gl, "expanded", gl4_exp, api);
1526 evas_object_smart_callback_add(gl, "contracted", gl4_con, api); 1527 evas_object_smart_callback_add(gl, "contracted", gl4_con, api);
1527 1528
1528 elm_box_pack_end(bx, gl); 1529 evas_object_smart_callback_add(ck1, "changed", _tree_effect_changed_cb, gl);
1530 evas_object_smart_callback_add(ck2, "changed", _tree_homogeneous_changed_cb, gl);
1529 1531
1530 evas_object_smart_callback_add(rd1, "changed", _tree_effect_enable_cb, gl); 1532 elm_box_pack_end(bx, gl);
1531 evas_object_smart_callback_add(rd2, "changed", _tree_effect_disable_cb, gl);
1532 1533
1533 evas_object_resize(win, 320, 320); 1534 evas_object_resize(win, 320, 320);
1534 evas_object_show(win); 1535 evas_object_show(win);
@@ -3112,6 +3113,18 @@ test_genlist17(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
3112 3113
3113 3114
3114/*** Genlist Tree and Decorate All Mode ************************************/ 3115/*** Genlist Tree and Decorate All Mode ************************************/
3116static void
3117_tree_effect_enable_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
3118{
3119 elm_genlist_tree_effect_enabled_set(data, EINA_TRUE);
3120}
3121
3122static void
3123_tree_effect_disable_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
3124{
3125 elm_genlist_tree_effect_enabled_set(data, EINA_FALSE);
3126}
3127
3115Evas_Object * 3128Evas_Object *
3116_tree_effect_frame_new(Evas_Object *win, Evas_Object **rdg, Evas_Object *gl) 3129_tree_effect_frame_new(Evas_Object *win, Evas_Object **rdg, Evas_Object *gl)
3117{ 3130{