aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/bin/test_gengrid.c
diff options
context:
space:
mode:
authorAnil Kumar Nahak <ak.nahak@samsung.com>2014-05-10 01:09:27 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-05-10 01:09:27 +0900
commitcae2b831a1442c909af91d2db773ddb44367aaf4 (patch)
treec201e72c127328a3e40c61859a80a8813980bcc6 /legacy/elementary/src/bin/test_gengrid.c
parentgenlist/gengrid: Use pan object geometry for focus highlight calculation (diff)
downloadefl-cae2b831a1442c909af91d2db773ddb44367aaf4.tar.gz
test_gengrid: Added a checkbox for enable/disable of reorder_mode feature
Summary: reorder mode can be enable/disable by clicking "'Reorder mode enable" checkbox Test Plan: elementary_test->"GenGrid" Reviewers: raster, seoz, nirajkr, singh.amitesh Reviewed By: seoz Differential Revision: https://phab.enlightenment.org/D829
Diffstat (limited to 'legacy/elementary/src/bin/test_gengrid.c')
-rw-r--r--legacy/elementary/src/bin/test_gengrid.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/legacy/elementary/src/bin/test_gengrid.c b/legacy/elementary/src/bin/test_gengrid.c
index 3beb6dc15f..784bfa9658 100644
--- a/legacy/elementary/src/bin/test_gengrid.c
+++ b/legacy/elementary/src/bin/test_gengrid.c
@@ -283,6 +283,12 @@ _cleanup_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
}
static void
+reorder_mode_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ elm_gengrid_reorder_mode_set(data, elm_check_state_get(obj));
+}
+
+static void
always_select_mode_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
if (elm_check_state_get(obj))
@@ -322,7 +328,6 @@ create_gengrid(Evas_Object *obj, int items)
elm_gengrid_item_size_set(grid,
elm_config_scale_get() * 200,
elm_config_scale_get() * 150);
- elm_gengrid_reorder_mode_set(grid, EINA_TRUE);
evas_object_smart_callback_add(grid, "selected", grid_selected, NULL);
evas_object_smart_callback_add(grid, "unselected", grid_unselected, NULL);
evas_object_smart_callback_add(grid, "clicked,double", grid_double_clicked, NULL);
@@ -530,6 +535,15 @@ test_gengrid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
ck = elm_check_add(win);
evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(ck, "Reorder mode enable");
+ evas_object_smart_callback_add(ck, "changed", reorder_mode_cb,
+ api->grid);
+ elm_box_pack_end(bx, ck);
+ evas_object_show(ck);
+
+ ck = elm_check_add(win);
+ evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_text_set(ck, "Always Select Mode");
evas_object_smart_callback_add(ck, "changed", always_select_mode_cb,
api->grid);
@@ -839,7 +853,6 @@ test_gengrid3(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
elm_config_scale_get() * 31,
elm_config_scale_get() * 31);
elm_gengrid_multi_select_set(grid, EINA_TRUE);
- elm_gengrid_reorder_mode_set(grid, EINA_TRUE);
evas_object_smart_callback_add(grid, "selected", grid_selected, NULL);
evas_object_smart_callback_add(grid, "clicked,double", grid_double_clicked, NULL);
evas_object_smart_callback_add(grid, "longpressed", grid_longpress, NULL);