Improve layouts created with setting_push_to_naviframe_with_back_button 28/233428/1
authorLukasz Stanislawski <lukasz.stanislawski@gmail.com>
Thu, 14 May 2020 13:53:16 +0000 (15:53 +0200)
committerLukasz Stanislawski <lukasz.stanislawski@gmail.com>
Thu, 14 May 2020 13:54:44 +0000 (15:54 +0200)
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

setting-common/src/setting-common-draw-genlist.c
setting-common/src/setting-common-draw-naviframe.c
setting-profile/src/setting-profile-other-sounds-view.c
setting-profile/src/setting-profile-sound-mode-view.c

index 81a34f199d1a195c5462fb7437c8910fbe14fe27..e2a3d9218754101cb3400d2fb995c88a05a2490b 100755 (executable)
@@ -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
index 035ee1eb655d67042936871ff7a14a02609f1cab..8a721a9ca2e0b853e889d914ceae8a1852693fc1 100644 (file)
@@ -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);
index 302d85d63f0c973a6ed8e42a7c922cf73bdc59dc..0ef38e1c0c8fdf4c3137e507445df3e5b0c019d8 100644 (file)
@@ -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++)
        {
index c617ba96756cb937e5bbca1f4bd6945c60e96e04..be479940f5e1b22b3912cacec9f1eb6c7c7c17b7 100644 (file)
@@ -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++)
        {