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)
downloadefl-d973bcc087d7e692c63348097422e9530415ee0e.tar.gz
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
{
if (efl_ui_spotlight_active_element_get(obj))
{
- if (!efl_pack_before(obj, view, efl_ui_spotlight_active_element_get(obj)))
+ if (!efl_pack_after(obj, view, efl_ui_spotlight_active_element_get(obj)))
return;
}
else
{
- if (!efl_pack_begin(obj, view))
+ if (!efl_pack_end(obj, view))
return;
}
@@ -769,9 +769,9 @@ _efl_ui_spotlight_container_pop(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Ei
return efl_loop_future_resolved(obj, v);
}
- new_index = efl_pack_index_get(obj, efl_ui_spotlight_active_element_get(obj)) + 1;
- if (new_index >= count)
- new_index -= 2;
+ new_index = efl_pack_index_get(obj, efl_ui_spotlight_active_element_get(obj)) - 1;
+ if (new_index < 0)
+ new_index += 2;
pd->transition_done.content = content;
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)
}
Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
efl_ui_spotlight_push(container, w);
- ck_assert_int_eq(efl_pack_index_get(container, w), 0);
- ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), efl_pack_content_get(container, 0));
+ ck_assert_int_eq(efl_pack_index_get(container, w), 1);
+ ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), efl_pack_content_get(container, 1));
}
EFL_END_TEST
@@ -556,7 +556,7 @@ EFL_START_TEST (efl_ui_spotlight_test_push2)
}
Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
efl_ui_spotlight_push(container, w);
- ck_assert_int_eq(efl_pack_index_get(container, w), 3);
+ ck_assert_int_eq(efl_pack_index_get(container, w), 4);
ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w);
}
EFL_END_TEST