summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-07-11 14:17:30 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-12 16:24:39 +0200
commita9504b9e75c4c9d9b1c76b4a06134f7a66faf88d (patch)
tree572dcefc6f1c5767101fefcc9e9c8dd1a0b3a17d
parent913af2f0d14b6cd2be487c62f2904abaaa419466 (diff)
elm_test: fix some range api misuse in spotlight test
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9286
-rw-r--r--src/bin/elementary/test_ui_spotlight.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/bin/elementary/test_ui_spotlight.c b/src/bin/elementary/test_ui_spotlight.c
index 589220b8e8..bcb6fbbd3e 100644
--- a/src/bin/elementary/test_ui_spotlight.c
+++ b/src/bin/elementary/test_ui_spotlight.c
@@ -299,7 +299,8 @@ pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
299 index = efl_ui_range_value_get(param->pack_sp); 299 index = efl_ui_range_value_get(param->pack_sp);
300 if (index > cnt) 300 if (index > cnt)
301 efl_ui_range_value_set(param->pack_sp, cnt); 301 efl_ui_range_value_set(param->pack_sp, cnt);
302 efl_ui_range_limits_set(param->pack_sp, 0, cnt); 302 if (cnt > 0)
303 efl_ui_range_limits_set(param->pack_sp, 0, cnt);
303 304
304 if (cnt > 0) 305 if (cnt > 0)
305 { 306 {
@@ -310,7 +311,8 @@ pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
310 index = efl_ui_range_value_get(param->unpack_sp); 311 index = efl_ui_range_value_get(param->unpack_sp);
311 if (index > cnt) 312 if (index > cnt)
312 efl_ui_range_value_set(param->unpack_sp, cnt); 313 efl_ui_range_value_set(param->unpack_sp, cnt);
313 efl_ui_range_limits_set(param->unpack_sp, 0, cnt); 314 if (cnt > 0)
315 efl_ui_range_limits_set(param->unpack_sp, 0, cnt);
314 } 316 }
315 else 317 else
316 { 318 {
@@ -502,6 +504,7 @@ pack_cb(void *data,
502 Eo *spotlight = params->spotlight; 504 Eo *spotlight = params->spotlight;
503 Eo *btn, *box, *in_box1, *in_box2, *sp1, *sp2; 505 Eo *btn, *box, *in_box1, *in_box2, *sp1, *sp2;
504 Pack_Params *pack_param; 506 Pack_Params *pack_param;
507 int num;
505 508
506 btn = efl_add(EFL_UI_BUTTON_CLASS, navi, 509 btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
507 efl_text_set(efl_added, "Back"), 510 efl_text_set(efl_added, "Back"),
@@ -517,11 +520,13 @@ pack_cb(void *data,
517 efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), 520 efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
518 efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL)); 521 efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL));
519 522
520 sp1 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box1, 523 sp1 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box1);
521 efl_ui_range_limits_set(efl_added, 0, 524 num = efl_content_count(spotlight);
522 efl_content_count(spotlight)), 525 if (num)
523 efl_ui_range_value_set(efl_added, 526 efl_ui_range_limits_set(sp1, 0, num);
524 efl_ui_spotlight_active_index_get(spotlight))); 527 num = efl_ui_spotlight_active_index_get(spotlight);
528 if (num >= 0)
529 efl_ui_range_value_set(sp1, num);
525 530
526 in_box2 = efl_add(EFL_UI_BOX_CLASS, box, 531 in_box2 = efl_add(EFL_UI_BOX_CLASS, box,
527 efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), 532 efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),