forked from enlightenment/efl
naviframe: Add "item,activated" smart callback.
"item,activated" smart callback is added to notice when an item is activated. "item,activated" smart callback is called as follows. 1. Item push is finished and the new item is activated. 2. Item pop is finished and the previous item is activated. void *event_info in smart callback is the activated item pointer.
This commit is contained in:
parent
8976be4f84
commit
3a0eb75bda
|
@ -44,6 +44,13 @@ _title_clicked(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
|
||||||
printf("Title Clicked!\n");
|
printf("Title Clicked!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_item_activated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
|
{
|
||||||
|
Elm_Object_Item *it = event_info;
|
||||||
|
printf("Item(%p) is activated! The Title is \"%s\"\n", it, elm_object_item_text_get(it));
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_title_visible(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
_title_visible(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -280,6 +287,7 @@ test_naviframe(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
|
||||||
elm_win_resize_object_add(win, nf);
|
elm_win_resize_object_add(win, nf);
|
||||||
evas_object_show(nf);
|
evas_object_show(nf);
|
||||||
evas_object_smart_callback_add(nf, "title,clicked", _title_clicked, 0);
|
evas_object_smart_callback_add(nf, "title,clicked", _title_clicked, 0);
|
||||||
|
evas_object_smart_callback_add(nf, "item,activated", _item_activated, NULL);
|
||||||
|
|
||||||
btn = elm_button_add(nf);
|
btn = elm_button_add(nf);
|
||||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
|
|
@ -30,6 +30,7 @@ static const char TITLE_ACCESS_PART[] = "access.title";
|
||||||
static const char SIG_TRANSITION_FINISHED[] = "transition,finished";
|
static const char SIG_TRANSITION_FINISHED[] = "transition,finished";
|
||||||
static const char SIG_TITLE_TRANSITION_FINISHED[] = "title,transition,finished";
|
static const char SIG_TITLE_TRANSITION_FINISHED[] = "title,transition,finished";
|
||||||
static const char SIG_TITLE_CLICKED[] = "title,clicked";
|
static const char SIG_TITLE_CLICKED[] = "title,clicked";
|
||||||
|
static const char SIG_ITEM_ACTIVATED[] = "item,activated";
|
||||||
|
|
||||||
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
||||||
{SIG_TRANSITION_FINISHED, ""},
|
{SIG_TRANSITION_FINISHED, ""},
|
||||||
|
@ -583,6 +584,8 @@ _elm_naviframe_item_efl_object_destructor(Eo *eo_item, Elm_Naviframe_Item_Data *
|
||||||
_prev_page_focus_recover(prev_it);
|
_prev_page_focus_recover(prev_it);
|
||||||
|
|
||||||
elm_object_signal_emit(VIEW(prev_it), "elm,state,visible", "elm");
|
elm_object_signal_emit(VIEW(prev_it), "elm,state,visible", "elm");
|
||||||
|
|
||||||
|
efl_event_callback_legacy_call(WIDGET(prev_it), ELM_NAVIFRAME_EVENT_ITEM_ACTIVATED, EO_OBJ(prev_it));
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
@ -1158,6 +1161,9 @@ _on_item_show_finished(void *data,
|
||||||
it->pushing = EINA_FALSE;
|
it->pushing = EINA_FALSE;
|
||||||
|
|
||||||
efl_event_callback_legacy_call(WIDGET(it), ELM_NAVIFRAME_EVENT_TRANSITION_FINISHED, EO_OBJ(it));
|
efl_event_callback_legacy_call(WIDGET(it), ELM_NAVIFRAME_EVENT_TRANSITION_FINISHED, EO_OBJ(it));
|
||||||
|
|
||||||
|
if (EO_OBJ(it) == elm_naviframe_top_item_get(WIDGET(it)))
|
||||||
|
efl_event_callback_legacy_call(WIDGET(it), ELM_NAVIFRAME_EVENT_ITEM_ACTIVATED, EO_OBJ(it));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1598,6 +1604,9 @@ _item_push_helper(Elm_Naviframe_Item_Data *item)
|
||||||
elm_object_signal_emit(VIEW(item), "elm,state,visible", "elm");
|
elm_object_signal_emit(VIEW(item), "elm,state,visible", "elm");
|
||||||
|
|
||||||
elm_layout_sizing_eval(obj);
|
elm_layout_sizing_eval(obj);
|
||||||
|
|
||||||
|
if (!top_item)
|
||||||
|
efl_event_callback_legacy_call(obj, ELM_NAVIFRAME_EVENT_ITEM_ACTIVATED, EO_OBJ(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Evas_Object *
|
EAPI Evas_Object *
|
||||||
|
@ -1712,6 +1721,9 @@ _elm_naviframe_item_insert_after(Eo *obj, Elm_Naviframe_Data *sd, Elm_Object_Ite
|
||||||
|
|
||||||
elm_layout_sizing_eval(obj);
|
elm_layout_sizing_eval(obj);
|
||||||
|
|
||||||
|
if (top_inserted)
|
||||||
|
efl_event_callback_legacy_call(obj, ELM_NAVIFRAME_EVENT_ITEM_ACTIVATED, eo_item);
|
||||||
|
|
||||||
return eo_item;
|
return eo_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -164,6 +164,7 @@ class Elm.Naviframe (Elm.Layout, Elm.Interface.Atspi_Widget_Action)
|
||||||
transition,finished;
|
transition,finished;
|
||||||
title,transition,finished;
|
title,transition,finished;
|
||||||
title,clicked;
|
title,clicked;
|
||||||
|
item,activated;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue