From 9389e8fdb453ea44a862adad148870c11f15d36a Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 11 Aug 2015 16:19:01 +0900 Subject: [PATCH] Add back button in event demo Change-Id: Idf0861642b642e0aaf0a8761e2b50aca559476b4 --- ism/demos/isf_event_efl.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ism/demos/isf_event_efl.cpp b/ism/demos/isf_event_efl.cpp index 4b95b8e..1ca9e36 100644 --- a/ism/demos/isf_event_efl.cpp +++ b/ism/demos/isf_event_efl.cpp @@ -260,6 +260,15 @@ static void _list_click (void *data, Evas_Object *obj, void *event_info) elm_list_item_selected_set (it, EINA_FALSE); } +static void _back_btn_clicked_cb (void *data, Evas_Object *obj, void *event_info) +{ + struct appdata *ad = (struct appdata *)data; + + if (!ad->vkbd_state) { + elm_naviframe_item_pop (ad->naviframe); + } +} + void isf_event_demo_bt (void *data, Evas_Object *obj, void *event_info) { struct appdata *ad = (struct appdata *)data; @@ -271,7 +280,14 @@ void isf_event_demo_bt (void *data, Evas_Object *obj, void *event_info) elm_list_item_append (ad->ev_li, "Entry Event", NULL, NULL, isf_entry_event_demo_bt, ad); elm_list_go (ad->ev_li); - elm_naviframe_item_push (ad->naviframe, _("Event"), NULL, NULL, ad->ev_li, NULL); + // create back key + Evas_Object *back_btn = elm_button_add (ad->naviframe); + if (!elm_object_style_set (back_btn, "naviframe/end_btn/default")) + LOGW ("Failed to set style of button\n"); + + evas_object_smart_callback_add (back_btn, "clicked", _back_btn_clicked_cb, ad); + + elm_naviframe_item_push (ad->naviframe, _("Event"), back_btn, NULL, ad->ev_li, NULL); } /* -- 2.7.4