summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2016-03-22 11:17:33 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2016-03-22 11:29:24 +0200
commit55a61d91ed45995bc8b0ee15929e7d50b71f7b1b (patch)
treeb7d907e6cb02e5758e969fdf1aec63be18c5fece /legacy
parent2584d25b750167dea61f8bb610b9e757007f696f (diff)
Label: adapt slide test to fit Exactness requirements
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/src/bin/test_label.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/legacy/elementary/src/bin/test_label.c b/legacy/elementary/src/bin/test_label.c
index 537360a076..8aaf2ef72e 100644
--- a/legacy/elementary/src/bin/test_label.c
+++ b/legacy/elementary/src/bin/test_label.c
@@ -150,10 +150,23 @@ _label_resize_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj,
150 elm_slider_value_set(speed_slider, elm_label_slide_speed_get(obj)); 150 elm_slider_value_set(speed_slider, elm_label_slide_speed_get(obj));
151} 151}
152 152
153static void
154_label_slide_stop_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
155{
156 Eina_List *lbs = data, *itr;
157 Evas_Object *lb;
158 EINA_LIST_FOREACH(lbs, itr, lb)
159 {
160 elm_label_slide_speed_set(lb, 0.01);
161 elm_label_slide_go(lb);
162 }
163}
164
153void 165void
154test_label_slide(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 166test_label_slide(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
155{ 167{
156 Evas_Object *win, *gd, *rect, *lb, *lb1, *lb2, *rd, *rdg, *sl; 168 Evas_Object *win, *gd, *rect, *lb, *lb1, *lb2, *rd, *rdg, *sl, *bt;
169 Eina_List *lbs = NULL;
157 170
158 win = elm_win_util_standard_add("label-slide", "Label Slide"); 171 win = elm_win_util_standard_add("label-slide", "Label Slide");
159 elm_win_autodel_set(win, EINA_TRUE); 172 elm_win_autodel_set(win, EINA_TRUE);
@@ -189,6 +202,7 @@ test_label_slide(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
189 elm_label_slide_go(lb); 202 elm_label_slide_go(lb);
190 elm_grid_pack(gd, lb, 5, 10, 90, 10); 203 elm_grid_pack(gd, lb, 5, 10, 90, 10);
191 evas_object_show(lb); 204 evas_object_show(lb);
205 lbs = eina_list_append(lbs, lb);
192 206
193 /* The speed or the duration of the slide animation will change when the 207 /* The speed or the duration of the slide animation will change when the
194 * label change size, so we need to update the sliders on resize. */ 208 * label change size, so we need to update the sliders on resize. */
@@ -245,6 +259,11 @@ test_label_slide(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
245 elm_grid_pack(gd, sl, 5, 40, 90, 10); 259 elm_grid_pack(gd, sl, 5, 40, 90, 10);
246 evas_object_show(sl); 260 evas_object_show(sl);
247 261
262 bt = elm_button_add(win);
263 elm_object_text_set(bt, "Stop sliding");
264 elm_grid_pack(gd, bt, 40, 50, 20, 10);
265 evas_object_show(bt);
266
248 /* Test 2 label at the same speed */ 267 /* Test 2 label at the same speed */
249 lb = elm_label_add(win); 268 lb = elm_label_add(win);
250 elm_object_text_set(lb, "<b>Test 2 label with the same speed:</b>"); 269 elm_object_text_set(lb, "<b>Test 2 label with the same speed:</b>");
@@ -257,7 +276,7 @@ test_label_slide(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
257 evas_object_show(rect); 276 evas_object_show(rect);
258 277
259 lb1 = elm_label_add(win); 278 lb1 = elm_label_add(win);
260 elm_object_style_set(lb1, "slide_long"); 279 elm_object_style_set(lb1, "slide_short");
261 elm_object_text_set(lb1, "This is a label set to slide with a fixed speed," 280 elm_object_text_set(lb1, "This is a label set to slide with a fixed speed,"
262 " should match the speed with the below label." 281 " should match the speed with the below label."
263 " This label has few extra char for testing."); 282 " This label has few extra char for testing.");
@@ -266,6 +285,7 @@ test_label_slide(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
266 elm_label_slide_go(lb1); 285 elm_label_slide_go(lb1);
267 elm_grid_pack(gd, lb1, 5, 70, 90, 10); 286 elm_grid_pack(gd, lb1, 5, 70, 90, 10);
268 evas_object_show(lb1); 287 evas_object_show(lb1);
288 lbs = eina_list_append(lbs, lb1);
269 289
270 lb2 = elm_label_add(win); 290 lb2 = elm_label_add(win);
271 elm_object_style_set(lb2, "slide_long"); 291 elm_object_style_set(lb2, "slide_long");
@@ -276,6 +296,9 @@ test_label_slide(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
276 elm_label_slide_go(lb2); 296 elm_label_slide_go(lb2);
277 elm_grid_pack(gd, lb2, 5, 80, 90, 10); 297 elm_grid_pack(gd, lb2, 5, 80, 90, 10);
278 evas_object_show(lb2); 298 evas_object_show(lb2);
299 lbs = eina_list_append(lbs, lb2);
300
301 evas_object_smart_callback_add(bt, "clicked", _label_slide_stop_cb, lbs);
279 302
280 evas_object_resize(win, 320, 320); 303 evas_object_resize(win, 320, 320);
281 evas_object_show(win); 304 evas_object_show(win);