From 330c21b836c12021234a0cc071643d862360e76f Mon Sep 17 00:00:00 2001 From: Amitesh Singh Date: Fri, 28 Aug 2015 13:54:50 +0530 Subject: [PATCH] test_gengrid: add item_select_on_focus_disabled option in gengrid2 test --- src/bin/test_gengrid.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/bin/test_gengrid.c b/src/bin/test_gengrid.c index 1de161a..e41f212 100644 --- a/src/bin/test_gengrid.c +++ b/src/bin/test_gengrid.c @@ -775,6 +775,15 @@ _size_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) elm_gengrid_item_size_set(grid, ELM_SCALE_SIZE(size), ELM_SCALE_SIZE(size)); } +static void +_gg_focus_item_select_on_focus_disable_changed_cb(void *data EINA_UNUSED, + Evas_Object *obj, + void *event_info + EINA_UNUSED) +{ + elm_config_item_select_on_focus_disabled_set(elm_check_state_get(obj)); +} + void test_gengrid2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { @@ -872,6 +881,17 @@ test_gengrid2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ elm_box_pack_end(hbx, ck); evas_object_show(ck); + ck = elm_check_add(hbx); + elm_object_text_set(ck, "Item Select on Focus disable"); + elm_check_state_set(ck, elm_config_item_select_on_focus_disabled_get()); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0); + evas_object_smart_callback_add(ck, "changed", + _gg_focus_item_select_on_focus_disable_changed_cb, + NULL); + elm_box_pack_end(hbx, ck); + evas_object_show(ck); + + gic = elm_gengrid_item_class_new(); gic->item_style = "default"; gic->func.text_get = grid_text_get; @@ -1669,15 +1689,6 @@ _grid_reorder_mode(void *data, Evas_Object *obj, } static void -_gg_focus_item_select_on_focus_disable_changed_cb(void *data EINA_UNUSED, - Evas_Object *obj, - void *event_info - EINA_UNUSED) -{ - elm_config_item_select_on_focus_disabled_set(elm_check_state_get(obj)); -} - -static void _gg_first_item_focus_on_first_focus_in_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) { -- 2.7.4