From: Lukasz Stanislawski Date: Thu, 14 May 2020 13:53:16 +0000 (+0200) Subject: Improve layouts created with setting_push_to_naviframe_with_back_button X-Git-Tag: submit/tizen/20200515.060529^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F233428%2F1;p=profile%2Fcommon%2Fapps%2Fnative%2Fsettings.git Improve layouts created with setting_push_to_naviframe_with_back_button The settings app generally have two major way of pushing new objects on elm_naviframe: * via view mechanism * via setting_push_to_naviframe_with_back_button func The second one hasn't been modified to new guideline requirements. This patch fixes it. Change-Id: I8c7a7d86ac5f5e37d4061eac5279ffc603106dde --- diff --git a/setting-common/src/setting-common-draw-genlist.c b/setting-common/src/setting-common-draw-genlist.c index 81a34f1..e2a3d92 100755 --- a/setting-common/src/setting-common-draw-genlist.c +++ b/setting-common/src/setting-common-draw-genlist.c @@ -1811,6 +1811,7 @@ void __gl_realized_cb(void *data, Evas_Object *obj, void *event_info) Elm_Object_Item *item = (Elm_Object_Item *)event_info; elm_object_item_data_get(item); + setting_genlist_item_1line_style_auto_apply_substyle(item); } EXPORT_PUBLIC diff --git a/setting-common/src/setting-common-draw-naviframe.c b/setting-common/src/setting-common-draw-naviframe.c index 035ee1e..8a721a9 100644 --- a/setting-common/src/setting-common-draw-naviframe.c +++ b/setting-common/src/setting-common-draw-naviframe.c @@ -191,9 +191,15 @@ Elm_Object_Item *setting_push_to_naviframe_with_back_button(char *title_str, NAVI_BACK_ARROW_BUTTON_STYLE, __softkey_back_click_cb, naviframe); + Evas_Object *layout = elm_layout_add(naviframe); + const char *path = setting_get_resource_path("edje/main_layout.edj"); + elm_layout_file_set(layout, path, "settings/main_layout"); + + elm_object_content_set(layout, content); + /* push "content" to naviframe with Arrow button */ navi_it = elm_naviframe_item_push(naviframe, title_str, lbtn, NULL, - content, NULL); /* add new button */ + layout, NULL); /* add new button */ if (item_pop_cb) elm_naviframe_item_pop_cb_set(navi_it, item_pop_cb, cb_data); diff --git a/setting-profile/src/setting-profile-other-sounds-view.c b/setting-profile/src/setting-profile-other-sounds-view.c index 302d85d..0ef38e1 100644 --- a/setting-profile/src/setting-profile-other-sounds-view.c +++ b/setting-profile/src/setting-profile-other-sounds-view.c @@ -85,6 +85,7 @@ static int _view_create(void *cb) _("IDS_ST_MBODY_OTHER_SOUNDS"), NULL, _naviframe_item_pop_cb, ad, &genlist, ad->md.naviframe); setting_view_other_sounds.is_create = TRUE; + evas_object_smart_callback_add(genlist, "realized", __gl_realized_cb, NULL); for (int i = 0; i < ARRAY_SIZE(items); i++) { diff --git a/setting-profile/src/setting-profile-sound-mode-view.c b/setting-profile/src/setting-profile-sound-mode-view.c index c617ba9..be47994 100644 --- a/setting-profile/src/setting-profile-sound-mode-view.c +++ b/setting-profile/src/setting-profile-sound-mode-view.c @@ -88,6 +88,7 @@ static int _view_create(void *cb) sound_mode_e current_mode = setting_profile_get_sound_mode(); Evas_Object *radio_group = elm_radio_add(genlist); + evas_object_smart_callback_add(genlist, "realized", __gl_realized_cb, NULL); for (int i = 0; i < ARRAY_SIZE(items); i++) {