From 62e48f5f69949e9e2fa395144a15eb8092bf0dc6 Mon Sep 17 00:00:00 2001 From: "moon87.park" Date: Wed, 18 Nov 2015 15:40:40 +0900 Subject: [PATCH] [Telegram] Change the entry layout and Add the attach_panel_hide when back key is pressed Change-Id: I7b0eef4172d004c9c3ae15fa0aafb747a9d43862 --- TelegramTizen/res/edje/telegram_init_screen.edc | 237 ++++++++++++++++++------ TelegramTizen/src/tg_messaging_view.c | 214 ++++++++------------- 2 files changed, 263 insertions(+), 188 deletions(-) diff --git a/TelegramTizen/res/edje/telegram_init_screen.edc b/TelegramTizen/res/edje/telegram_init_screen.edc index ea0bc19..57460e4 100644 --- a/TelegramTizen/res/edje/telegram_init_screen.edc +++ b/TelegramTizen/res/edje/telegram_init_screen.edc @@ -37,7 +37,7 @@ styles { collections { base_scale: 2.6; - + #define WIN_WIDTH 720 #define WIN_HEIGHT 1280 @@ -77,7 +77,7 @@ collections { align: 0.0 0.0; \ } \ } - + #define PADDING_BOTTOM(param_padding_name, param_padding_size) \ part \ { \ @@ -95,7 +95,7 @@ collections { align: 0.0 1.0; \ } \ } - + #define PADDING_RIGHT(param_padding_name, param_padding_size) \ part \ { \ @@ -139,6 +139,9 @@ collections { image: "telegram_circle_btn_ic_call.png" COMP; image: "Telegram_caller_id_default_bg_full.png" COMP; image: "telegram_caller_id_default_masking_full.png" COMP; + image: "telegram_emotion.png" COMP; + image: "telegram_add_object.png" COMP; + image: "telegram_send.png" COMP; } group { @@ -602,7 +605,7 @@ collections { parts { part { name: "main_box"; - type: SWALLOW; + type: SWALLOW; description { state: "default" 0.0; rel1 { relative: 0.0 0.0; } @@ -612,18 +615,18 @@ collections { } part { name: "new_chat_icon"; - type: SWALLOW; + type: SWALLOW; description { state: "default" 0.0; rel1 { relative: 0.75 0.85; } rel2 { relative: 0.85 0.95; } - color: 50 50 111 111; + color: 50 50 111 111; } } } } - - + + group { name: "user_main_screen_new"; parts { @@ -1119,7 +1122,7 @@ group description{ state: "default" 0.0; rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 1.0; } + rel2 { relative: 1.0 0.0; to_y: "swallow.entry"; } color: 0 0 0 0; } } @@ -1129,7 +1132,7 @@ group description { state: "default" 0.0; rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 1.0; } + rel2 { relative: 1.0 0.0; to_y: "swallow.entry"; } align: 0.5 0.5; text { style: "nomessage,display"; @@ -1164,6 +1167,29 @@ group color: 0 0 0 0; } } + part { + name: "entry,bg"; + type: RECT; + description { + state: "default" 0.0; + rel1.to: "swallow.entry"; + rel2.to: "swallow.entry"; + color: 255 255 255 255; + visible: 1; + } + } + part{ + name: "swallow.entry"; + type: SWALLOW; + description{ + state: "default" 0.0; + rel1 { relative: 0.0 1.0; } + rel2 { relative: 1.0 1.0; } + align: 0.5 1.0; + fixed: 0 1; + visible: 1; + } + } } //parts programs { program { @@ -1182,8 +1208,7 @@ group } } } - - + group { name: "full_screen"; @@ -1201,78 +1226,186 @@ group } } } - - + group { name: "chat_entry_box"; parts{ part { name: "bg"; - type: RECT; + type: SPACER; description { state: "default" 0.0; rel1 { relative: 0.0 0.0; } rel2 { relative: 1.0 1.0; } - color: 0 0 0 0; + min: 0 135; } } - - part{ - name: "swallow.smiely_icon"; - type:SWALLOW; + part{ + name: "image,divider"; + type: IMAGE; description{ state: "default" 0.0; - rel1 { relative: 0.0 0.2; } - rel2 { relative: 0.1 0.92; } + rel1 { relative: 0.0 0.0; to, "bg"; } + rel2 { relative: 1.0 0.0; to, "bg"; } + min: 0 2; + fixed: 0 1; + image { + normal: "telegram_date_divider.#.png"; + } + color: 115 115 115 51; } } - - part{ - name: "swallow.text_entry,bg"; + part { + name: "left,pad"; + type: SPACER; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 0.0 1.0; to: "bg"; } + align: 0.0 0.5; + min: 24 0; + fixed: 1 0; + } + } + part { + name: "right,pad"; + type: SPACER; + description { + state: "default" 0.0; + rel1 { relative: 1.0 0.0; to: "bg"; } + rel2 { relative: 1.0 1.0; to: "bg"; } + align: 1.0 0.5; + min: 24 0; + fixed: 1 0; + } + } + part { + name: "image,smile"; type: IMAGE; description{ state: "default" 0.0; - rel1 { relative: 0.0 0.93; to, "swallow.text_entry"; } - rel2 { relative: 1.0 1.0; to, "swallow.text_entry"; } - max: 800 2; - image { - normal: "telegram_date_divider.#.png"; - } - color: 0 0 0 51; + rel1 { relative: 1.0 0.5; to: "left,pad"; } + rel2 { relative: 1.0 0.5; to: "left,pad"; } + fixed: 1 1; + min: 72 72; + align: 0.0 0.5; + image.normal: "telegram_emotion.png"; + color: 45 165 224 225; } - } - - part{ - name: "swallow.text_entry"; - type:SWALLOW; + } + part { + name: "image,attach"; + type: IMAGE; description{ state: "default" 0.0; - rel1 { relative: 0.11 0.1; } - rel2 { relative: 0.79 0.9; } + rel1 { relative: 0.0 0.5; to: "right,pad"; } + rel2 { relative: 0.0 0.5; to: "right,pad"; } + fixed: 1 1; + min: 72 72; + align: 1.0 0.5; + image.normal: "telegram_add_object.png"; + color: 45 165 224 225; } - } - part{ - name: "swallow.attach_icon"; - type:SWALLOW; + description { + state: "attach,hide" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "image,send"; + type: IMAGE; description{ state: "default" 0.0; - rel1 { relative: 0.81 0.2; } - rel2 { relative: 0.91 0.92; } + rel1 { relative: 0.0 0.5; to: "right,pad"; } + rel2 { relative: 0.0 0.5; to: "right,pad"; } + fixed: 1 1; + min: 72 72; + align: 1.0 0.5; + image.normal: "telegram_send.png"; + color: 45 165 224 225; + visible: 0; } - } - part{ - name: "swallow.send_icon"; + description { + state: "attach,hide" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "left,text,pad"; + type: SPACER; + description { + state: "default" 0.0; + rel1 { relative: 1.0 0.0; to_x: "image,smile"; to_y: "bg"; } + rel2 { relative: 1.0 1.0; to_x: "image,smile"; to_y: "bg"; } + align: 0.0 0.5; + min: 12 0; + fixed: 1 0; + } + } + part { + name: "right,text,pad"; + type: SPACER; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0; to_x: "image,attach"; to_y: "bg"; } + rel2 { relative: 0.0 1.0; to_x: "image,attach"; to_y: "bg"; } + align: 1.0 0.5; + min: 12 0; + fixed: 1 0; + } + } + part{ + name: "swallow.text_entry"; type:SWALLOW; description{ state: "default" 0.0; - rel1 { relative: 0.91 0.1; } - rel2 { relative: 1.0 0.97; } + rel1 { relative: 1.0 0.0; to: "left,text,pad"; } + rel2 { relative: 0.0 1.0; to: "right,text,pad"; } + align: 0.0 0.5; } } - } + } //parts + programs { + program { + name: "attach,hide"; + signal: "hide"; + source: "attach_btn"; + action: STATE_SET "attach,hide" 0.0; + target: "image,send"; + target: "image,attach"; + } + program { + name: "attach,show"; + signal: "show"; + source: "attach_btn"; + action: STATE_SET "default" 0.0; + target: "image,send"; + target: "image,attach"; + } + program { + name: "smile,clicked"; + signal: "mouse,clicked,1"; + source: "image,smile"; + action: SIGNAL_EMIT "smile" "clicked"; + } + program { + name: "attach,clicked"; + signal: "mouse,clicked,1"; + source: "image,attach"; + action: SIGNAL_EMIT "attach" "clicked"; + } + program { + name: "send,clicked"; + signal: "mouse,clicked,1"; + source: "image,send"; + action: SIGNAL_EMIT "send" "clicked"; + } + } //programs } - + group { name: "custom_gen_list"; diff --git a/TelegramTizen/src/tg_messaging_view.c b/TelegramTizen/src/tg_messaging_view.c index 0aa44c4..6970661 100644 --- a/TelegramTizen/src/tg_messaging_view.c +++ b/TelegramTizen/src/tg_messaging_view.c @@ -1827,7 +1827,7 @@ static Eina_Bool on_new_text_message_send_cb(void *data) return ECORE_CALLBACK_CANCEL; } -static void on_text_message_send_clicked(void *data, Evas_Object *obj, void *event_info) +static void on_text_message_send_clicked(void *data, Evas_Object *obj, const char *emission, const char *source) { Evas_Object* chat_list = data; appdata_s* ad = evas_object_data_get(chat_list, "app_data"); @@ -2072,34 +2072,52 @@ void on_user_presence_state_changed(appdata_s* ad, int buddy_id) static Eina_Bool on_change_input_type_requested(void *data) { Evas_Object* text_entry = data; - - elm_entry_input_panel_layout_set(text_entry, ELM_INPUT_PANEL_LAYOUT_EMOTICON); + if (!text_entry) { + LOGE("Fail to get the text_entry"); + return ECORE_CALLBACK_CANCEL; + } elm_object_focus_set(text_entry, EINA_TRUE); + elm_entry_input_panel_layout_set(text_entry, ELM_INPUT_PANEL_LAYOUT_EMOTICON); elm_entry_input_panel_show(text_entry); return ECORE_CALLBACK_CANCEL; } -static void on_message_smiley_clicked(void *data, Evas_Object *obj, void *event_info) +static void on_message_smiley_clicked(void *data, Evas_Object *obj, const char *emission, const char *source) { Evas_Object* text_entry = data; - elm_object_focus_set(obj, EINA_FALSE); - elm_object_focus_set(text_entry, EINA_FALSE); - elm_entry_input_panel_hide(text_entry); + if (!text_entry) { + LOGE("Fail to get the text_entry"); + return; + } ecore_timer_add(0.3, on_change_input_type_requested, text_entry); - /* - elm_entry_input_panel_layout_set(text_entry, ELM_INPUT_PANEL_LAYOUT_EMOTICON); - elm_object_focus_set(text_entry, EINA_TRUE); - elm_entry_input_panel_show(text_entry);*/ } static void on_message_text_entry_clicked(void *data, Evas_Object *obj, void *event_info) { - elm_entry_input_panel_hide(obj); - elm_entry_input_panel_layout_set(obj,ELM_INPUT_PANEL_LAYOUT_NORMAL); - elm_entry_input_panel_show(obj); + if (!obj) { + LOGE("Fail to get the entry"); + return; + } + /* This Api is needed for type of keyboard: emoticon or caractor */ + elm_entry_input_panel_layout_set(obj, ELM_INPUT_PANEL_LAYOUT_NORMAL); } +static void on_message_text_entry_changed(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *layout = data; + + if (!layout) { + LOGE("Fail to get the entry layout"); + return; + } + + if (elm_entry_is_empty(obj)) { + elm_object_signal_emit(layout, "show", "attach_btn"); + } else { + elm_object_signal_emit(layout, "hide", "attach_btn"); + } +} Evas_Object* create_chat_genlist(Evas_Object *win) { @@ -2960,7 +2978,7 @@ void on_media_attach_dismissed_cb(void *data, Evas_Object *obj, void *event_info evas_object_del(obj); } -static void on_media_attach_clicked(void *data, Evas_Object *obj, void *event_info) +static void on_media_attach_clicked(void *data, Evas_Object *obj, const char *emission, const char *source) { Evas_Object* chat_list = data; appdata_s *ad = evas_object_data_get(chat_list, "app_data"); @@ -3008,18 +3026,6 @@ static void on_text_message_send_unpressed(void *data, Evas_Object *obj, void *e } #endif -static void on_message_smiley_pressed(void *data, Evas_Object *obj, void *event_info) -{ - if (data) - evas_object_color_set(data, 45, 165, 224, 178); -} - -static void on_message_smiley_unpressed(void *data, Evas_Object *obj, void *event_info) -{ - if (data) - evas_object_color_set(data, 45, 165, 224, 255); -} - void on_message_back_button_clicked(void *data, Evas_Object *obj, void *event_info) { appdata_s *ad = data; @@ -3131,6 +3137,21 @@ static void on_expand_button_clicked(void *data, Evas_Object *obj, void *event_i evas_object_data_set(expand_pic, "is_expanded", (void *)is_expanded); } +static Eina_Bool _pop_cb(void *data, Elm_Object_Item *it) +{ + appdata_s *ad = data; + attach_panel_h attach_panel = NULL; + if (!ad) { + LOGE("Failed to get the ad"); + return EINA_FALSE; + } + attach_panel = evas_object_data_get(ad->conform, "attach_panel"); + if (attach_panel) { + attach_panel_hide(attach_panel); + } + + return EINA_TRUE; +} void launch_messaging_view_cb(appdata_s* ad, int user_id) { @@ -3159,7 +3180,7 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id) peer_with_pic_s *sel_item = eina_list_nth(ad->peer_list, user_id); tg_peer_info_s* user = sel_item->use_data; - /*************************** message list ************************************/ + /*************************** START: message list ************************************/ Evas_Object* msg_box_layout = elm_layout_add(ad->nf); elm_layout_file_set(msg_box_layout, edj_path, "custom_gen_list"); @@ -3182,142 +3203,62 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id) elm_object_part_content_set(msg_box_layout, "swallow.gen_list.bg", list_bg); Evas_Object *chat_conv_list = elm_genlist_add(ad->nf); - elm_list_mode_set(chat_conv_list, ELM_LIST_COMPRESS); elm_genlist_mode_set(chat_conv_list, ELM_LIST_COMPRESS); elm_object_style_set(chat_conv_list, "solid/default"); evas_object_size_hint_weight_set(chat_conv_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(chat_conv_list, EVAS_HINT_FILL, EVAS_HINT_FILL); - // FIXME: Deprecated API - //elm_genlist_realization_mode_set(chat_conv_list, EINA_TRUE); - //evas_object_color_set(chat_conv_list, 255 , 255, 255, 255); - evas_object_show(chat_conv_list); - elm_object_part_content_set(msg_box_layout, "swallow.gen_list", chat_conv_list); - - elm_object_part_content_set(layout, "swallow.chat_box", msg_box_layout); - /*************************** message list ************************************/ - - /********************** entry layout*******************************/ + /********************** START: entry layout*******************************/ Evas_Object* entry_box_layout = elm_layout_add(ad->win); + if (!entry_box_layout) { + LOGE("Fail to add the entry box layout"); + } + elm_layout_file_set(entry_box_layout, edj_path, "chat_entry_box"); evas_object_size_hint_align_set(entry_box_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(entry_box_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(entry_box_layout); + Evas_Object *entry_layout = elm_layout_add(entry_box_layout); + if (!entry_layout) { + LOGE("Fail to add the entry_layout"); + } + elm_layout_theme_set(entry_layout, "layout", "editfield", "singleline"); + + Evas_Object* text_entry = elm_entry_add(entry_layout); + if (!text_entry) { + LOGE("Fail to add the text_entry"); + } - Evas_Object* attach_btn = elm_button_add(entry_box_layout); - elm_object_style_set(attach_btn, "transparent"); - evas_object_size_hint_align_set(attach_btn, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(attach_btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - Evas_Object* attach_icon = elm_image_add(entry_box_layout); - evas_object_size_hint_align_set(attach_icon, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(attach_icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_image_file_set(attach_icon, ui_utils_get_resource(TG_ATTACH_ICON), NULL); - evas_object_show(attach_icon); - evas_object_color_set(attach_icon, 45, 165, 224, 255); - - Evas_Object* attach_pic_layout = elm_layout_add(ad->nf); - elm_layout_file_set(attach_pic_layout, edj_path, "circle_layout"); - evas_object_size_hint_weight_set(attach_pic_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(attach_pic_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(attach_pic_layout); - elm_object_part_content_set(attach_pic_layout, "content", attach_icon); - elm_object_content_set(attach_btn, attach_pic_layout); - - evas_object_smart_callback_add(attach_btn, "clicked", on_media_attach_clicked, chat_conv_list); - evas_object_smart_callback_add(attach_btn, "pressed", on_message_smiley_pressed, attach_icon); - evas_object_smart_callback_add(attach_btn, "unpressed", on_message_smiley_unpressed, attach_icon); - elm_object_part_content_set(entry_box_layout, "swallow.attach_icon", attach_btn); - - Evas_Object* text_entry = elm_entry_add(entry_box_layout); - elm_object_part_text_set(text_entry, "elm.guide", "Text message"); + elm_object_part_text_set(text_entry, "elm.guide", "Text message"); elm_entry_line_wrap_set(text_entry, EINA_TRUE); + elm_entry_scrollable_set(text_entry, EINA_TRUE); evas_object_size_hint_align_set(text_entry, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(text_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(text_entry); - elm_entry_scrollable_set(text_entry, EINA_TRUE); - //elm_entry_end_visible_set(text_entry, EINA_TRUE); - elm_entry_icon_visible_set(text_entry, EINA_TRUE); - elm_entry_line_wrap_set(text_entry, ELM_WRAP_MIXED); - evas_object_smart_callback_add(text_entry, "clicked", on_message_text_entry_clicked, ad); - elm_object_part_content_set(entry_box_layout, "swallow.text_entry", text_entry); - - elm_entry_text_style_user_push(text_entry, "DEFAULT='font_size=32 color=#000000 align=left font=Tizen:style=Normal'"); - - //evas_object_data_set(chat_conv_list, "text_entry", (void*)text_entry); - - - Evas_Object* smiley_btn = elm_button_add(entry_box_layout); - elm_object_style_set(smiley_btn, "transparent"); - evas_object_size_hint_align_set(smiley_btn, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(smiley_btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - Evas_Object* smiley_icon = elm_image_add(entry_box_layout); - evas_object_size_hint_align_set(smiley_icon, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(smiley_icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - elm_image_file_set(smiley_icon, ui_utils_get_resource(TG_SMILEY_ICON), NULL); - - elm_image_resizable_set(smiley_icon, EINA_TRUE, EINA_TRUE); - evas_object_show(smiley_icon); - evas_object_color_set(smiley_icon, 45, 165, 224, 255); - - Evas_Object* smiley_pic_layout = elm_layout_add(ad->nf); - elm_layout_file_set(smiley_pic_layout, edj_path, "circle_layout"); - evas_object_size_hint_weight_set(smiley_pic_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(smiley_pic_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(smiley_pic_layout); - elm_object_part_content_set(smiley_pic_layout, "content", smiley_icon); - - elm_object_content_set(smiley_btn, smiley_pic_layout); - - evas_object_smart_callback_add(smiley_btn, "clicked", on_message_smiley_clicked, text_entry); - - - evas_object_smart_callback_add(smiley_btn, "pressed", on_message_smiley_pressed, smiley_icon); - evas_object_smart_callback_add(smiley_btn, "unpressed", on_message_smiley_unpressed, smiley_icon); - - - elm_object_part_content_set(entry_box_layout, "swallow.smiely_icon", smiley_btn); - - Evas_Object* send_btn = elm_button_add(entry_box_layout); - elm_object_style_set(send_btn, "transparent"); - evas_object_size_hint_align_set(send_btn, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(send_btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - Evas_Object* send_icon = elm_image_add(entry_box_layout); - evas_object_size_hint_align_set(send_icon, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(send_icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_image_file_set(send_icon, ui_utils_get_resource(TG_SEND_ICON), NULL); - evas_object_show(send_icon); - evas_object_color_set(send_icon, 45, 165, 224, 255); - Evas_Object* send_pic_layout = elm_layout_add(ad->nf); - elm_layout_file_set(send_pic_layout, edj_path, "circle_layout"); - evas_object_size_hint_weight_set(send_pic_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(send_pic_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(send_pic_layout); - elm_object_part_content_set(send_pic_layout, "content", send_icon); - elm_object_content_set(send_btn, send_pic_layout); + elm_object_part_content_set(entry_layout, "elm.swallow.content", text_entry); + evas_object_smart_callback_add(text_entry, "changed", on_message_text_entry_changed, entry_box_layout); + evas_object_smart_callback_add(text_entry, "clicked", on_message_text_entry_clicked, NULL); + elm_object_part_content_set(entry_box_layout, "swallow.text_entry", entry_layout); - evas_object_smart_callback_add(send_btn, "clicked", on_text_message_send_clicked, chat_conv_list); - evas_object_smart_callback_add(send_btn, "pressed", on_message_smiley_pressed, send_icon); - evas_object_smart_callback_add(send_btn, "unpressed", on_message_smiley_unpressed, send_icon); - elm_object_part_content_set(entry_box_layout, "swallow.send_icon", send_btn); + /* button clicked event */ + elm_object_signal_callback_add(entry_box_layout, "smile", "clicked", on_message_smiley_clicked, text_entry); + elm_object_signal_callback_add(entry_box_layout, "attach", "clicked", on_media_attach_clicked, chat_conv_list); + elm_object_signal_callback_add(entry_box_layout, "send", "clicked", on_text_message_send_clicked, chat_conv_list); - /********************** entry layout*******************************/ + /********************** END: entry layout*******************************/ evas_object_data_set(ad->nf, "chat_list", (void*)chat_conv_list); evas_object_data_set(chat_conv_list, "app_data", ad); evas_object_data_set(chat_conv_list, "user_id", (void*)user_id); evas_object_data_set(chat_conv_list, "text_entry", (void*)text_entry); - // Title: name + /* Set the name in title area */ char temp_name[512] = {'\0'}; @@ -3330,7 +3271,7 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id) } Elm_Object_Item *nf_it = elm_naviframe_item_push(ad->nf, temp_name, NULL, NULL, layout, NULL); - elm_object_item_part_content_set(nf_it, "toolbar", entry_box_layout); + elm_object_part_content_set(layout, "swallow.entry", entry_box_layout); evas_object_data_set(ad->nf, "navi_item", nf_it); on_user_presence_state_changed(ad, sel_item->use_data->peer_id); @@ -3338,6 +3279,7 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id) Evas_Object *back_btn = create_button(ad->nf, "naviframe/back_btn/default", NULL); evas_object_smart_callback_add(back_btn, "clicked", on_message_back_button_clicked, ad); elm_object_item_part_content_set(nf_it, "title_left_btn", back_btn); + elm_naviframe_item_pop_cb_set(nf_it, _pop_cb, ad); /******************** expand ************************/ if (user->peer_type == TGL_PEER_CHAT) { -- 2.7.4