summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-02-14 17:37:42 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-17 10:29:53 +0100
commit95a2b3457a9656c271abf93318c5e9a551d43b7b (patch)
tree462b0bb8ab8adc8fddbf3d1e075a82adcb2143c6
parentefd09a21d98c5fc486bf0899604435b3062cbe98 (diff)
efl_ui_spotlight_manager: introduce a reason for switch_to
This is preparation work for a later commit. This brings a flag that indicates what the reason for a switch to call is, either a jump a push or a pop. Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es> Differential Revision: https://phab.enlightenment.org/D11357
-rw-r--r--src/lib/elementary/efl_ui_spotlight_container.c22
-rw-r--r--src/lib/elementary/efl_ui_spotlight_fade_manager.c2
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager.eo8
-rw-r--r--src/lib/elementary/efl_ui_spotlight_plain_manager.c2
-rw-r--r--src/lib/elementary/efl_ui_spotlight_scroll_manager.c2
5 files changed, 25 insertions, 11 deletions
diff --git a/src/lib/elementary/efl_ui_spotlight_container.c b/src/lib/elementary/efl_ui_spotlight_container.c
index 74be9c5b83..5df66e518c 100644
--- a/src/lib/elementary/efl_ui_spotlight_container.c
+++ b/src/lib/elementary/efl_ui_spotlight_container.c
@@ -437,10 +437,8 @@ _efl_ui_spotlight_container_efl_pack_linear_pack_index_get(Eo *obj EINA_UNUSED,
437 return eina_list_data_idx(pd->content_list, (void *)subobj); 437 return eina_list_data_idx(pd->content_list, (void *)subobj);
438} 438}
439 439
440EOLIAN static void 440static void
441_efl_ui_spotlight_container_active_element_set(Eo *obj EINA_UNUSED, 441_active_element_set(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Efl_Ui_Widget *new_page, Efl_Ui_Spotlight_Manager_Switch_Reason reason)
442 Efl_Ui_Spotlight_Container_Data *pd,
443 Efl_Ui_Widget *new_page)
444{ 442{
445 int before = -1; 443 int before = -1;
446 int index; 444 int index;
@@ -463,7 +461,16 @@ _efl_ui_spotlight_container_active_element_set(Eo *obj EINA_UNUSED,
463 } 461 }
464 462
465 pd->curr.page = new_page; 463 pd->curr.page = new_page;
466 efl_ui_spotlight_manager_switch_to(pd->transition, before, index); 464 efl_ui_spotlight_manager_switch_to(pd->transition, before, index, reason);
465
466}
467
468EOLIAN static void
469_efl_ui_spotlight_container_active_element_set(Eo *obj EINA_UNUSED,
470 Efl_Ui_Spotlight_Container_Data *pd,
471 Efl_Ui_Widget *new_page)
472{
473 _active_element_set(obj, pd, new_page, EFL_UI_SPOTLIGHT_MANAGER_SWITCH_REASON_JUMP);
467} 474}
468 475
469EOLIAN static Efl_Ui_Widget* 476EOLIAN static Efl_Ui_Widget*
@@ -724,8 +731,7 @@ _efl_ui_spotlight_container_push(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd EI
724 if (!efl_pack_end(obj, view)) 731 if (!efl_pack_end(obj, view))
725 return; 732 return;
726 } 733 }
727 734 _active_element_set(obj, pd, view, EFL_UI_SPOTLIGHT_MANAGER_SWITCH_REASON_PUSH);
728 efl_ui_spotlight_active_element_set(obj, view);
729} 735}
730 736
731static Eina_Value 737static Eina_Value
@@ -780,7 +786,7 @@ _efl_ui_spotlight_container_pop(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Ei
780 if (del) 786 if (del)
781 transition_done = eina_future_then(transition_done, _delete_obj, NULL); 787 transition_done = eina_future_then(transition_done, _delete_obj, NULL);
782 788
783 efl_ui_spotlight_active_element_set(obj, efl_pack_content_get(obj, new_index)); 789 _active_element_set(obj, pd, efl_pack_content_get(obj, new_index), EFL_UI_SPOTLIGHT_MANAGER_SWITCH_REASON_POP);
784 790
785 return transition_done; 791 return transition_done;
786} 792}
diff --git a/src/lib/elementary/efl_ui_spotlight_fade_manager.c b/src/lib/elementary/efl_ui_spotlight_fade_manager.c
index 559a220a92..441bb38896 100644
--- a/src/lib/elementary/efl_ui_spotlight_fade_manager.c
+++ b/src/lib/elementary/efl_ui_spotlight_fade_manager.c
@@ -135,7 +135,7 @@ is_valid(Eo *obj, int index)
135} 135}
136 136
137EOLIAN static void 137EOLIAN static void
138_efl_ui_spotlight_fade_manager_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_Ui_Spotlight_Fade_Manager_Data *pd, int from, int to) 138_efl_ui_spotlight_fade_manager_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_Ui_Spotlight_Fade_Manager_Data *pd, int from, int to, Efl_Ui_Spotlight_Manager_Switch_Reason reason EINA_UNUSED)
139{ 139{
140 if (efl_pack_content_get(pd->container, to) == pd->content[1]) 140 if (efl_pack_content_get(pd->container, to) == pd->content[1])
141 return; 141 return;
diff --git a/src/lib/elementary/efl_ui_spotlight_manager.eo b/src/lib/elementary/efl_ui_spotlight_manager.eo
index 6de4898a94..00e338443d 100644
--- a/src/lib/elementary/efl_ui_spotlight_manager.eo
+++ b/src/lib/elementary/efl_ui_spotlight_manager.eo
@@ -1,3 +1,10 @@
1enum @beta Efl.Ui.Spotlight.Manager_Switch_Reason {
2 [[Indicator for the reason of a @Efl.Ui.Spotlight.Manager.switch_to call]]
3 jump, [[The Reason for this switch is a casual jump caused by @Efl.Ui.Spotlight.Container.active_element]]
4 push, [[The Reason for this switch is a casual jump caused by @Efl.Ui.Spotlight.Container.push]]
5 pop [[The Reason for this switch is a casual jump caused by @Efl.Ui.Spotlight.Container.pop]]
6}
7
1abstract @beta Efl.Ui.Spotlight.Manager extends Efl.Object { 8abstract @beta Efl.Ui.Spotlight.Manager extends Efl.Object {
2 [[Manager object used by @Efl.Ui.Spotlight.Container to handle rendering and animation of its sub-widgets, 9 [[Manager object used by @Efl.Ui.Spotlight.Container to handle rendering and animation of its sub-widgets,
3 and user interaction. 10 and user interaction.
@@ -41,6 +48,7 @@ abstract @beta Efl.Ui.Spotlight.Manager extends Efl.Object {
41 params { 48 params {
42 from : int; [[Index of the starting sub-widget in the container's list. Might be -1 if unknown.]] 49 from : int; [[Index of the starting sub-widget in the container's list. Might be -1 if unknown.]]
43 to : int; [[Index of the target sub-widget in the container's list.]] 50 to : int; [[Index of the target sub-widget in the container's list.]]
51 reason : Efl.Ui.Spotlight.Manager_Switch_Reason; [[The reason for this switch to call]]
44 } 52 }
45 } 53 }
46 @property size @pure_virtual { 54 @property size @pure_virtual {
diff --git a/src/lib/elementary/efl_ui_spotlight_plain_manager.c b/src/lib/elementary/efl_ui_spotlight_plain_manager.c
index d120ef8f11..5075641704 100644
--- a/src/lib/elementary/efl_ui_spotlight_plain_manager.c
+++ b/src/lib/elementary/efl_ui_spotlight_plain_manager.c
@@ -108,7 +108,7 @@ _efl_ui_spotlight_plain_manager_efl_ui_spotlight_manager_content_del(Eo *obj, Ef
108 _content_changed(obj, pd); 108 _content_changed(obj, pd);
109} 109}
110EOLIAN static void 110EOLIAN static void
111_efl_ui_spotlight_plain_manager_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_Ui_Spotlight_Plain_Manager_Data *pd, int from EINA_UNUSED, int to) 111_efl_ui_spotlight_plain_manager_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_Ui_Spotlight_Plain_Manager_Data *pd, int from EINA_UNUSED, int to, Efl_Ui_Spotlight_Manager_Switch_Reason reason EINA_UNUSED)
112{ 112{
113 Efl_Gfx_Entity *to_obj, *from_obj; 113 Efl_Gfx_Entity *to_obj, *from_obj;
114 to_obj = efl_pack_content_get(pd->container, to); 114 to_obj = efl_pack_content_get(pd->container, to);
diff --git a/src/lib/elementary/efl_ui_spotlight_scroll_manager.c b/src/lib/elementary/efl_ui_spotlight_scroll_manager.c
index 63147c1d1b..f6eb1323e6 100644
--- a/src/lib/elementary/efl_ui_spotlight_scroll_manager.c
+++ b/src/lib/elementary/efl_ui_spotlight_scroll_manager.c
@@ -285,7 +285,7 @@ _animation_request_switch(Eo *obj, Efl_Ui_Spotlight_Scroll_Manager_Data *pd, int
285} 285}
286 286
287EOLIAN static void 287EOLIAN static void
288_efl_ui_spotlight_scroll_manager_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_Ui_Spotlight_Scroll_Manager_Data *pd, int from, int to) 288_efl_ui_spotlight_scroll_manager_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_Ui_Spotlight_Scroll_Manager_Data *pd, int from, int to, Efl_Ui_Spotlight_Manager_Switch_Reason reason EINA_UNUSED)
289{ 289{
290 if (pd->animation) 290 if (pd->animation)
291 { 291 {