summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-12-03 11:48:56 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-12-03 14:38:28 +0100
commitd973bcc087d7e692c63348097422e9530415ee0e (patch)
treec684ac944a46a6e188e1adde24091541d6be7f47
parent7787b16e20bef12967b8a6bd74d6d8e6516a8066 (diff)
efl_ui_spotlight_container: reverse push and pop semantics
before this commit, push would add before the current element, pop would return to the next higher element. after this commit, push would add after the current element, pop would return to the previous element. ref T7991 Differential Revision: https://phab.enlightenment.org/D10781
-rw-r--r--src/lib/elementary/efl_ui_spotlight_container.c10
-rw-r--r--src/tests/elementary/efl_ui_test_spotlight.c6
2 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/elementary/efl_ui_spotlight_container.c b/src/lib/elementary/efl_ui_spotlight_container.c
index 8f38012f0d..a5f3c9e390 100644
--- a/src/lib/elementary/efl_ui_spotlight_container.c
+++ b/src/lib/elementary/efl_ui_spotlight_container.c
@@ -716,12 +716,12 @@ _efl_ui_spotlight_container_push(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd EI
716{ 716{
717 if (efl_ui_spotlight_active_element_get(obj)) 717 if (efl_ui_spotlight_active_element_get(obj))
718 { 718 {
719 if (!efl_pack_before(obj, view, efl_ui_spotlight_active_element_get(obj))) 719 if (!efl_pack_after(obj, view, efl_ui_spotlight_active_element_get(obj)))
720 return; 720 return;
721 } 721 }
722 else 722 else
723 { 723 {
724 if (!efl_pack_begin(obj, view)) 724 if (!efl_pack_end(obj, view))
725 return; 725 return;
726 } 726 }
727 727
@@ -769,9 +769,9 @@ _efl_ui_spotlight_container_pop(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Ei
769 return efl_loop_future_resolved(obj, v); 769 return efl_loop_future_resolved(obj, v);
770 } 770 }
771 771
772 new_index = efl_pack_index_get(obj, efl_ui_spotlight_active_element_get(obj)) + 1; 772 new_index = efl_pack_index_get(obj, efl_ui_spotlight_active_element_get(obj)) - 1;
773 if (new_index >= count) 773 if (new_index < 0)
774 new_index -= 2; 774 new_index += 2;
775 775
776 pd->transition_done.content = content; 776 pd->transition_done.content = content;
777 pd->transition_done.transition_done = efl_loop_promise_new(obj); 777 pd->transition_done.transition_done = efl_loop_promise_new(obj);
diff --git a/src/tests/elementary/efl_ui_test_spotlight.c b/src/tests/elementary/efl_ui_test_spotlight.c
index 3bf99aca54..9d5f433e44 100644
--- a/src/tests/elementary/efl_ui_test_spotlight.c
+++ b/src/tests/elementary/efl_ui_test_spotlight.c
@@ -540,8 +540,8 @@ EFL_START_TEST (efl_ui_spotlight_test_push1)
540 } 540 }
541 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win); 541 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
542 efl_ui_spotlight_push(container, w); 542 efl_ui_spotlight_push(container, w);
543 ck_assert_int_eq(efl_pack_index_get(container, w), 0); 543 ck_assert_int_eq(efl_pack_index_get(container, w), 1);
544 ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), efl_pack_content_get(container, 0)); 544 ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), efl_pack_content_get(container, 1));
545} 545}
546EFL_END_TEST 546EFL_END_TEST
547 547
@@ -556,7 +556,7 @@ EFL_START_TEST (efl_ui_spotlight_test_push2)
556 } 556 }
557 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win); 557 Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
558 efl_ui_spotlight_push(container, w); 558 efl_ui_spotlight_push(container, w);
559 ck_assert_int_eq(efl_pack_index_get(container, w), 3); 559 ck_assert_int_eq(efl_pack_index_get(container, w), 4);
560 ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w); 560 ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w);
561} 561}
562EFL_END_TEST 562EFL_END_TEST