raster pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=00d92b92fe190676280846120b83f9cbde87bfe3
commit 00d92b92fe190676280846120b83f9cbde87bfe3 Author: Jaehyun Cho <jae_hyun....@samsung.com> Date: Mon Feb 17 21:03:01 2014 +0900 naviframe: Fix to set only top view to be focusable Summary: Previously, all views were focusable except during transition. Now, only top view is focusable. Reviewers: seoz CC: Hermet Differential Revision: https://phab.enlightenment.org/D554 --- src/lib/elc_naviframe.c | 29 +++++++++++++---------------- src/lib/elm_widget_naviframe.h | 1 - 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c index 891ac6c..b47a72d 100644 --- a/src/lib/elc_naviframe.c +++ b/src/lib/elc_naviframe.c @@ -517,13 +517,6 @@ _item_del_pre_hook(Elm_Object_Item *it) if (evas_object_data_get(VIEW(nit), "out_of_list")) goto end; - //FIXME: Really need? - if (!sd->on_deletion) - { - nit->unfocusable = elm_widget_tree_unfocusable_get(VIEW(nit)); - elm_widget_tree_unfocusable_set(VIEW(nit), EINA_TRUE); - } - sd->stack = eina_inlist_remove(sd->stack, EINA_INLIST_GET(nit)); if (top && !sd->on_deletion) /* must raise another one */ @@ -533,6 +526,9 @@ _item_del_pre_hook(Elm_Object_Item *it) Elm_Naviframe_Item); if (!prev_it) goto end; + elm_widget_tree_unfocusable_set(VIEW(prev_it), EINA_FALSE); + elm_widget_tree_unfocusable_set(VIEW(nit), EINA_TRUE); + if (sd->freeze_events) evas_object_freeze_events_set(VIEW(prev_it), EINA_FALSE); _resize_object_reset(WIDGET(prev_it), prev_it); @@ -1081,8 +1077,6 @@ _on_item_push_finished(void *data, evas_object_hide(VIEW(it)); - elm_widget_tree_unfocusable_set(VIEW(it), it->unfocusable); - if (sd->freeze_events) evas_object_freeze_events_set(VIEW(it), EINA_FALSE); } @@ -1100,7 +1094,7 @@ _on_item_pop_finished(void *data, ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd); if (sd->preserve) - elm_widget_tree_unfocusable_set(VIEW(it), it->unfocusable); + elm_widget_tree_unfocusable_set(VIEW(it), EINA_FALSE); sd->popping = eina_list_remove(sd->popping, it); elm_widget_item_del(data); @@ -1121,8 +1115,6 @@ _on_item_show_finished(void *data, elm_object_signal_emit(VIEW(it), "elm,state,visible", "elm"); - elm_widget_tree_unfocusable_set(VIEW(it), it->unfocusable); - _prev_page_focus_recover(it); if (sd->freeze_events) @@ -1546,7 +1538,6 @@ _item_push(Eo *obj, void *_pd, va_list *list) edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it))); edje_object_message_signal_process(elm_layout_edje_get(VIEW(it))); - prev_it->unfocusable = elm_widget_tree_unfocusable_get(VIEW(prev_it)); elm_widget_tree_unfocusable_set(VIEW(prev_it), EINA_TRUE); ecore_animator_del(it->animator); @@ -1611,6 +1602,8 @@ _item_insert_before(Eo *obj, void *_pd, va_list *list) (sd->stack, EINA_INLIST_GET(it), EINA_INLIST_GET(((Elm_Naviframe_Item *)before))); + elm_widget_tree_unfocusable_set(VIEW(it), EINA_TRUE); + elm_layout_sizing_eval(obj); *ret = (Elm_Object_Item *)it; @@ -1662,6 +1655,7 @@ _item_insert_after(Eo *obj, void *_pd, va_list *list) if (top_inserted) { elm_widget_focused_object_clear(VIEW(after)); + elm_widget_tree_unfocusable_set(VIEW(after), EINA_TRUE); _resize_object_reset(obj, it); evas_object_show(VIEW(it)); evas_object_hide(VIEW(after)); @@ -1729,9 +1723,6 @@ _item_pop(Eo *obj, void *_pd, va_list *list) evas_object_data_set(VIEW(it), "out_of_list", (void *)1); - it->unfocusable = elm_widget_tree_unfocusable_get(VIEW(it)); - elm_widget_tree_unfocusable_set(VIEW(it), EINA_TRUE); - if (sd->stack->last->prev) prev_it = EINA_INLIST_CONTAINER_GET (sd->stack->last->prev, Elm_Naviframe_Item); @@ -1740,6 +1731,9 @@ _item_pop(Eo *obj, void *_pd, va_list *list) if (prev_it) { + elm_widget_tree_unfocusable_set(VIEW(prev_it), EINA_FALSE); + elm_widget_tree_unfocusable_set(VIEW(it), EINA_TRUE); + if (sd->freeze_events) { evas_object_freeze_events_set(VIEW(it), EINA_TRUE); @@ -1828,6 +1822,9 @@ elm_naviframe_item_promote(Elm_Object_Item *it) elm_widget_focused_object_clear(VIEW(nit)); _resize_object_reset(WIDGET(it), nit); + elm_widget_tree_unfocusable_set(VIEW(nit), EINA_FALSE); + elm_widget_tree_unfocusable_set(VIEW(prev_it), EINA_TRUE); + if (sd->freeze_events) { evas_object_freeze_events_set(VIEW(it), EINA_TRUE); diff --git a/src/lib/elm_widget_naviframe.h b/src/lib/elm_widget_naviframe.h index f4b8019..ee93801 100644 --- a/src/lib/elm_widget_naviframe.h +++ b/src/lib/elm_widget_naviframe.h @@ -57,7 +57,6 @@ struct _Elm_Naviframe_Item int ref; Eina_Bool title_enabled : 1; - Eina_Bool unfocusable : 1; Eina_Bool popping : 1; /**< a flag to notify the item is on poping. this flag is set true at the start of item pop. */ Eina_Bool delete_me : 1; /**< a flag to notify the item is on deletion. this flag is set true at the start of item deletion. */ }; --