aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/bin
diff options
context:
space:
mode:
authornirajkr <niraj.kr@samsung.com>2014-03-21 17:00:46 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-21 17:00:46 +0900
commitfcfeba5097ccf392a00509a62d58c404a3d8ac1f (patch)
treeacdc295b35bb2aff3dfb14207a27975a6907bda7 /legacy/elementary/src/bin
parentfix scrollbar to be clickable even if vieport is tiny compared to content (diff)
downloadefl-fcfeba5097ccf392a00509a62d58c404a3d8ac1f.tar.gz
gengrid : Implementation for gengrid item focus support
Summary: Implemented the following API to support gengrid item_focus 1. _elm_gengrid_focus_highlight_geometry_get 2. _elm_gengrid_focused_item_get 3. _item_focus_up 4. _item_focus_down 5. _item_focus_right 6. _item_focus_down 7. _item_focus_set_hook 8. _item_focus_get_hook 9. _item_focused 10. _item_unfocused 11. Changes in the smart_event, pan_calculation, smart_on_focus to support item focus Reviewers: seoz, woohyun, singh.amitesh, raster CC: raster Differential Revision: https://phab.enlightenment.org/D550
Diffstat (limited to 'legacy/elementary/src/bin')
-rw-r--r--legacy/elementary/src/bin/test.c2
-rw-r--r--legacy/elementary/src/bin/test_gengrid.c90
2 files changed, 92 insertions, 0 deletions
diff --git a/legacy/elementary/src/bin/test.c b/legacy/elementary/src/bin/test.c
index 2d333f291f..31349b6fad 100644
--- a/legacy/elementary/src/bin/test.c
+++ b/legacy/elementary/src/bin/test.c
@@ -132,6 +132,7 @@ void test_gengrid3(void *data, Evas_Object *obj, void *event_info);
void test_gengrid_item_styles(void *data, Evas_Object *obj, void *event_info);
void test_gengrid4(void *data, Evas_Object *obj, void *event_info);
void test_gengrid_speed(void *data, Evas_Object *obj, void *event_info);
+void test_gengrid_item_focus(void *data, Evas_Object *obj, void *event_info);
void test_win_state(void *data, Evas_Object *obj, void *event_info);
void test_win_state2(void *data, Evas_Object *obj, void *event_info);
void test_progressbar(void *data, Evas_Object *obj, void *event_info);
@@ -663,6 +664,7 @@ add_tests:
ADD_TEST(NULL, "Lists - Gengrid", "GenGrid Show/Bring_in", test_gengrid4);
ADD_TEST(NULL, "Lists - Gengrid", "GenGrid Item Styles", test_gengrid_item_styles);
ADD_TEST(NULL, "Lists - Gengrid", "Gengrid Update Speed", test_gengrid_speed);
+ ADD_TEST(NULL, "Lists - Gengrid", "GenGrid Item Focus", test_gengrid_item_focus);
//------------------------------//
ADD_TEST(NULL, "General", "Scaling", test_scaling);
diff --git a/legacy/elementary/src/bin/test_gengrid.c b/legacy/elementary/src/bin/test_gengrid.c
index 36658c9493..048a1c61a2 100644
--- a/legacy/elementary/src/bin/test_gengrid.c
+++ b/legacy/elementary/src/bin/test_gengrid.c
@@ -1304,6 +1304,96 @@ test_gengrid_speed(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
elm_config_scale_get() * 36);
elm_object_content_set(fr, api->grid);
evas_object_show(api->grid);
+ evas_object_resize(win, 600, 600);
+ evas_object_show(win);
+}
+
+void
+test_gengrid_item_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;
+ Elm_Gengrid_Item_Class *ic;
+ Item_Data *id;
+ char buf[PATH_MAX];
+ int i, n;
+
+ win = elm_win_util_standard_add("gengrid-item-focus", "Gengrid Item Focus");
+ elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
+ elm_win_focus_highlight_animate_set(win, EINA_TRUE);
+ elm_win_autodel_set(win, EINA_TRUE);
+
+ bx_horiz = elm_box_add(win);
+ elm_box_horizontal_set(bx_horiz, EINA_TRUE);
+ evas_object_size_hint_weight_set(bx_horiz, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, bx_horiz);
+ evas_object_show(bx_horiz);
+
+ btn = elm_button_add(bx_horiz);
+ elm_object_text_set(btn, "Left");
+ elm_box_pack_end(bx_horiz, btn);
+ evas_object_show(btn);
+
+ bx = elm_box_add(bx_horiz);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ 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);
+ evas_object_show(btn);
+ elm_object_focus_set(btn, EINA_TRUE);
+
+ gengrid = elm_gengrid_add(bx);
+ elm_gengrid_item_size_set(gengrid,
+ elm_config_scale_get() * 150,
+ elm_config_scale_get() * 150);
+ evas_object_size_hint_weight_set(gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_box_pack_end(bx, gengrid);
+ evas_object_show(gengrid);
+
+ btn = elm_button_add(bx);
+ elm_object_text_set(btn, "Down");
+ elm_box_pack_end(bx, btn);
+ evas_object_show(btn);
+
+ btn = elm_button_add(bx_horiz);
+ elm_object_text_set(btn, "Right");
+ elm_box_pack_end(bx_horiz, btn);
+ evas_object_show(btn);
+
+ ic = elm_gengrid_item_class_new();
+ ic->item_style = "default";
+ ic->func.text_get = grid_text_get;
+ ic->func.content_get = grid_content_get;
+ ic->func.state_get = NULL;
+ ic->func.del = grid_del;
+
+ n = 0;
+ for (i = 0; i < 24; i++)
+ {
+ id = calloc(1, sizeof(Item_Data));
+ snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), img[n]);
+ n = (n + 1) % 9;
+ id->mode = i;
+ id->path = eina_stringshare_add(buf);
+ id->item = elm_gengrid_item_append(gengrid, ic, id, NULL, NULL);
+ }
+ elm_gengrid_item_class_free(ic);
evas_object_resize(win, 600, 600);
evas_object_show(win);