forked from enlightenment/efl
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
This commit is contained in:
parent
efd09a21d9
commit
95a2b3457a
|
@ -437,10 +437,8 @@ _efl_ui_spotlight_container_efl_pack_linear_pack_index_get(Eo *obj EINA_UNUSED,
|
|||
return eina_list_data_idx(pd->content_list, (void *)subobj);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_spotlight_container_active_element_set(Eo *obj EINA_UNUSED,
|
||||
Efl_Ui_Spotlight_Container_Data *pd,
|
||||
Efl_Ui_Widget *new_page)
|
||||
static void
|
||||
_active_element_set(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Efl_Ui_Widget *new_page, Efl_Ui_Spotlight_Manager_Switch_Reason reason)
|
||||
{
|
||||
int before = -1;
|
||||
int index;
|
||||
|
@ -463,7 +461,16 @@ _efl_ui_spotlight_container_active_element_set(Eo *obj EINA_UNUSED,
|
|||
}
|
||||
|
||||
pd->curr.page = new_page;
|
||||
efl_ui_spotlight_manager_switch_to(pd->transition, before, index);
|
||||
efl_ui_spotlight_manager_switch_to(pd->transition, before, index, reason);
|
||||
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_spotlight_container_active_element_set(Eo *obj EINA_UNUSED,
|
||||
Efl_Ui_Spotlight_Container_Data *pd,
|
||||
Efl_Ui_Widget *new_page)
|
||||
{
|
||||
_active_element_set(obj, pd, new_page, EFL_UI_SPOTLIGHT_MANAGER_SWITCH_REASON_JUMP);
|
||||
}
|
||||
|
||||
EOLIAN static Efl_Ui_Widget*
|
||||
|
@ -724,8 +731,7 @@ _efl_ui_spotlight_container_push(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd EI
|
|||
if (!efl_pack_end(obj, view))
|
||||
return;
|
||||
}
|
||||
|
||||
efl_ui_spotlight_active_element_set(obj, view);
|
||||
_active_element_set(obj, pd, view, EFL_UI_SPOTLIGHT_MANAGER_SWITCH_REASON_PUSH);
|
||||
}
|
||||
|
||||
static Eina_Value
|
||||
|
@ -780,7 +786,7 @@ _efl_ui_spotlight_container_pop(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Ei
|
|||
if (del)
|
||||
transition_done = eina_future_then(transition_done, _delete_obj, NULL);
|
||||
|
||||
efl_ui_spotlight_active_element_set(obj, efl_pack_content_get(obj, new_index));
|
||||
_active_element_set(obj, pd, efl_pack_content_get(obj, new_index), EFL_UI_SPOTLIGHT_MANAGER_SWITCH_REASON_POP);
|
||||
|
||||
return transition_done;
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ is_valid(Eo *obj, int index)
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_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_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)
|
||||
{
|
||||
if (efl_pack_content_get(pd->container, to) == pd->content[1])
|
||||
return;
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
enum @beta Efl.Ui.Spotlight.Manager_Switch_Reason {
|
||||
[[Indicator for the reason of a @Efl.Ui.Spotlight.Manager.switch_to call]]
|
||||
jump, [[The Reason for this switch is a casual jump caused by @Efl.Ui.Spotlight.Container.active_element]]
|
||||
push, [[The Reason for this switch is a casual jump caused by @Efl.Ui.Spotlight.Container.push]]
|
||||
pop [[The Reason for this switch is a casual jump caused by @Efl.Ui.Spotlight.Container.pop]]
|
||||
}
|
||||
|
||||
abstract @beta Efl.Ui.Spotlight.Manager extends Efl.Object {
|
||||
[[Manager object used by @Efl.Ui.Spotlight.Container to handle rendering and animation of its sub-widgets,
|
||||
and user interaction.
|
||||
|
@ -41,6 +48,7 @@ abstract @beta Efl.Ui.Spotlight.Manager extends Efl.Object {
|
|||
params {
|
||||
from : int; [[Index of the starting sub-widget in the container's list. Might be -1 if unknown.]]
|
||||
to : int; [[Index of the target sub-widget in the container's list.]]
|
||||
reason : Efl.Ui.Spotlight.Manager_Switch_Reason; [[The reason for this switch to call]]
|
||||
}
|
||||
}
|
||||
@property size @pure_virtual {
|
||||
|
|
|
@ -108,7 +108,7 @@ _efl_ui_spotlight_plain_manager_efl_ui_spotlight_manager_content_del(Eo *obj, Ef
|
|||
_content_changed(obj, pd);
|
||||
}
|
||||
EOLIAN static void
|
||||
_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_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)
|
||||
{
|
||||
Efl_Gfx_Entity *to_obj, *from_obj;
|
||||
to_obj = efl_pack_content_get(pd->container, to);
|
||||
|
|
|
@ -285,7 +285,7 @@ _animation_request_switch(Eo *obj, Efl_Ui_Spotlight_Scroll_Manager_Data *pd, int
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_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_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)
|
||||
{
|
||||
if (pd->animation)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue