summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2019-07-31 09:16:51 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-31 12:21:06 +0200
commitb218dcbc3f874672fde32cbfca414c39598a8689 (patch)
tree4386c0ffd5c277b080e1ebab6e364d3e0455924c /src/bin
parent8dbdcff3cb1e544682eb6c5be6d9ecab618619e4 (diff)
efl_ui_spotlight: pop() unpacks content although there is one content
Previously, pop() does not unpack content if there is one content. Now, pop() unpacks content without transition if there is one content. Since there is no transition, NULL future is returned. Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9450
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/elementary/test_ui_spotlight.c59
1 files changed, 55 insertions, 4 deletions
diff --git a/src/bin/elementary/test_ui_spotlight.c b/src/bin/elementary/test_ui_spotlight.c
index 698d23158f..4b81f8acfb 100644
--- a/src/bin/elementary/test_ui_spotlight.c
+++ b/src/bin/elementary/test_ui_spotlight.c
@@ -140,6 +140,57 @@ next_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
140 efl_ui_spotlight_active_index_set(spotlight, active_index + 1); 140 efl_ui_spotlight_active_index_set(spotlight, active_index + 1);
141} 141}
142 142
143static Eina_Value
144future_then_cb(void *data EINA_UNUSED, const Eina_Value value, const Eina_Future *dead_future EINA_UNUSED)
145{
146 /* If efl_ui_spotlight_pop is called with EINA_FALSE, then the content is not
147 * deleted and the value contains the content. */
148 Eo *content = eina_value_object_get(&value);
149 if (content)
150 efl_gfx_entity_visible_set(content, EINA_FALSE);
151
152 return EINA_VALUE_EMPTY;
153}
154
155static void
156pop_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
157{
158 Eo *spotlight = data;
159
160 if (efl_content_count(spotlight) == 0) return;
161
162 Eina_Future *future = efl_ui_spotlight_pop(spotlight, EINA_TRUE);
163 eina_future_then(future, future_then_cb, NULL);
164}
165
166static void
167push_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
168{
169 Eo *spotlight = data;
170 Eo *view;
171 int count = efl_content_count(spotlight);
172
173 switch (count % 3)
174 {
175 case 0:
176 view = view_add(BUTTON, spotlight);
177 break;
178
179 case 1:
180 view = view_add(LIST, spotlight);
181 break;
182
183 case 2:
184 view = view_add(LAYOUT, spotlight);
185 break;
186
187 default:
188 view = view_add(LAYOUT, spotlight);
189 break;
190 }
191 efl_ui_spotlight_push(spotlight, view);
192}
193
143static void 194static void
144back_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) 195back_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED)
145{ 196{
@@ -842,15 +893,15 @@ test_ui_spotlight_stack(void *data EINA_UNUSED,
842 efl_ui_spotlight_manager_set(spotlight, efl_new(EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS)); 893 efl_ui_spotlight_manager_set(spotlight, efl_new(EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS));
843 894
844 efl_add(EFL_UI_BUTTON_CLASS, layout, 895 efl_add(EFL_UI_BUTTON_CLASS, layout,
845 efl_text_set(efl_added, "Prev"), 896 efl_text_set(efl_added, "Pop"),
846 efl_event_callback_add(efl_added, 897 efl_event_callback_add(efl_added,
847 EFL_INPUT_EVENT_CLICKED, prev_btn_cb, spotlight), 898 EFL_INPUT_EVENT_CLICKED, pop_btn_cb, spotlight),
848 efl_content_set(efl_part(layout, "prev_btn"), efl_added)); 899 efl_content_set(efl_part(layout, "prev_btn"), efl_added));
849 900
850 efl_add(EFL_UI_BUTTON_CLASS, layout, 901 efl_add(EFL_UI_BUTTON_CLASS, layout,
851 efl_text_set(efl_added, "Next"), 902 efl_text_set(efl_added, "Push"),
852 efl_event_callback_add(efl_added, 903 efl_event_callback_add(efl_added,
853 EFL_INPUT_EVENT_CLICKED, next_btn_cb, spotlight), 904 EFL_INPUT_EVENT_CLICKED, push_btn_cb, spotlight),
854 efl_content_set(efl_part(layout, "next_btn"), efl_added)); 905 efl_content_set(efl_part(layout, "next_btn"), efl_added));
855 906
856 params = calloc(1, sizeof(Params)); 907 params = calloc(1, sizeof(Params));