aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/bin/test_gengrid.c
diff options
context:
space:
mode:
authorAmitesh Singh <amitesh.sh@samsung.com>2014-04-03 18:39:30 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-04-03 18:39:30 +0900
commit81ff09a877dd2cceaacac276ffa853f0b50e0126 (patch)
tree1813e26955c3084a0f8ff26aabff279e5144a02a /legacy/elementary/src/bin/test_gengrid.c
parentgengrid: Added feature to move focus out of gengrid if focus is on edge items. (diff)
downloadefl-81ff09a877dd2cceaacac276ffa853f0b50e0126.tar.gz
test_gengrid: Added more test cases to reveal bugs in horizontal mode.
Summary: - Added focus highlight, focus animation & horizontal mode option to enable/disable. - Removed unnecessary frame and label from test code. Test Plan: elementary_test -to "Gengrid Focus" Reviewers: seoz, raster CC: seoz, nirajkr Differential Revision: https://phab.enlightenment.org/D683
Diffstat (limited to 'legacy/elementary/src/bin/test_gengrid.c')
-rw-r--r--legacy/elementary/src/bin/test_gengrid.c71
1 files changed, 59 insertions, 12 deletions
diff --git a/legacy/elementary/src/bin/test_gengrid.c b/legacy/elementary/src/bin/test_gengrid.c
index 4d5341a66f..0b26e957b0 100644
--- a/legacy/elementary/src/bin/test_gengrid.c
+++ b/legacy/elementary/src/bin/test_gengrid.c
@@ -1336,13 +1336,30 @@ test_gengrid_focus_focus_move_policy_changed(void *data EINA_UNUSED,
elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_IN);
}
+static void
+_test_gengrid_focus_focus_highlight_check_changed(void *data,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ elm_win_focus_highlight_enabled_set((Evas_Object *)data,
+ elm_check_state_get(obj));
+}
+
+static void
+_test_gengrid_focus_focus_animate_check_changed(void *data,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ elm_win_focus_highlight_animate_set((Evas_Object *)data,
+ elm_check_state_get(obj));
+}
+
void
test_gengrid_focus(void *data EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
- Evas_Object *win, *bx, *bx_horiz, *gengrid, *btn, *fr, *lb, *bx_mv, *rdg,
- *rd;
+ Evas_Object *win, *bx, *bx_horiz, *gengrid, *btn, *fr, *bx_mv, *bx_opt, *ck, *rdg, *rd;
Elm_Gengrid_Item_Class *ic;
Item_Data *id;
char buf[PATH_MAX];
@@ -1370,16 +1387,6 @@ test_gengrid_focus(void *data EINA_UNUSED,
elm_box_pack_end(bx_horiz, bx);
evas_object_show(bx);
- fr = elm_frame_add(bx);
- elm_object_text_set(fr, "Gengrid Item Focus");
- elm_box_pack_end(bx, fr);
- evas_object_show(fr);
-
- lb = elm_label_add(fr);
- elm_object_text_set(lb, "<align=left>Gengrid Item focus</align>");
- elm_object_content_set(fr, lb);
- evas_object_show(lb);
-
btn = elm_button_add(bx);
elm_object_text_set(btn, "Up");
elm_box_pack_end(bx, btn);
@@ -1413,6 +1420,46 @@ test_gengrid_focus(void *data EINA_UNUSED,
elm_box_pack_end(bx_horiz, btn);
evas_object_show(btn);
+ //Options
+ fr = elm_frame_add(bx);
+ elm_object_text_set(fr, "Options");
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_box_pack_end(bx, fr);
+ evas_object_show(fr);
+
+ bx_opt = elm_box_add(fr);
+ elm_box_horizontal_set(bx_opt, EINA_TRUE);
+ elm_object_content_set(fr, bx_opt);
+ evas_object_show(bx_opt);
+
+ ck = elm_check_add(bx_opt);
+ elm_object_text_set(ck, "Focus Highlight");
+ elm_check_state_set(ck, EINA_TRUE);
+ evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
+ evas_object_smart_callback_add(ck, "changed",
+ _test_gengrid_focus_focus_highlight_check_changed,
+ win);
+ elm_box_pack_end(bx_opt, ck);
+ evas_object_show(ck);
+
+ ck = elm_check_add(bx_opt);
+ elm_object_text_set(ck, "Focus Animation");
+ elm_check_state_set(ck, EINA_TRUE);
+ evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
+ evas_object_smart_callback_add(ck, "changed",
+ _test_gengrid_focus_focus_animate_check_changed,
+ win);
+ elm_box_pack_end(bx_opt, ck);
+ evas_object_show(ck);
+
+ ck = elm_check_add(bx_opt);
+ elm_object_text_set(ck, "Horizontal Mode");
+ evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
+ evas_object_smart_callback_add(ck, "changed", _horizontal_grid, gengrid);
+ elm_box_pack_end(bx_opt, ck);
+ evas_object_show(ck);
+
//Focus movement policy
fr = elm_frame_add(bx);
elm_object_text_set(fr, "Focus Movement Policy");