From 4df2c01a44155a015189058fa49bd12cb61525e4 Mon Sep 17 00:00:00 2001 From: Seonah Moon Date: Thu, 20 Aug 2020 16:59:43 +0900 Subject: [PATCH] iot common: change advanced view style Change-Id: Iff76cfd993a24ad99da96a668c6adc192a20b79b --- ui-gadget/view_advanced.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/ui-gadget/view_advanced.c b/ui-gadget/view_advanced.c index 9ce78f8..3ba8a92 100644 --- a/ui-gadget/view_advanced.c +++ b/ui-gadget/view_advanced.c @@ -240,16 +240,21 @@ static char *_gl_sort_by_text_get(void *data, Evas_Object *obj, const char *part) { char buf[1024]; - if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) { + const char *text_part = (common_util_get_ug_type() == UG_VIEW_IOT_COMMON) + ? g_genlist_info[WIFI_GENLIST_2LINE_STYLE].text_part + : g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part; + const char *sub_text_part = (common_util_get_ug_type() == UG_VIEW_IOT_COMMON) + ? g_genlist_info[WIFI_GENLIST_2LINE_STYLE].sub_text_part + : g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_text_part; + + if (!strcmp(text_part, part)) { int i18type = GPOINTER_TO_INT(data); if (i18type != 0) { snprintf(buf, 1023, "%s", sc(PACKAGE, i18type)); return strdup(buf); } - } else if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_text_part, part)) { - int value; - - value = _convert_vconf_to_sort_by_value( + } else if (!strcmp(sub_text_part, part)) { + int value = _convert_vconf_to_sort_by_value( common_util_get_system_registry(VCONF_SORT_BY)); if (value >= 0) { snprintf(buf, 1023, "%s", sc(PACKAGE, value)); @@ -385,8 +390,11 @@ static Evas_Object *_gl_content_get_network_noti(void *data, { Evas_Object *toggle_btn = NULL; int ret; + const char *content_part = (common_util_get_ug_type() == UG_VIEW_IOT_COMMON) + ? g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].content_part + : g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].sub_content_part; - if (!strcmp(g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].sub_content_part, part)) { + if (!strcmp(content_part, part)) { toggle_btn = elm_check_add(obj); evas_object_size_hint_align_set(toggle_btn, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(toggle_btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -731,7 +739,11 @@ static Evas_Object *_create_list(Evas_Object *parent) #endif /* Sort By */ - itc_sort_by.item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name; + if (common_util_get_ug_type() == UG_VIEW_IOT_COMMON) + itc_sort_by.item_style = g_genlist_info[WIFI_GENLIST_2LINE_STYLE].style_name; + else + itc_sort_by.item_style = g_genlist_info[WIFI_GENLIST_1LINE_STYLE].style_name; + g_pd.item_sort_by = elm_genlist_item_append(gl, &itc_sort_by, (const void *) I18N_TYPE_Sort_by, NULL, ELM_GENLIST_ITEM_NONE, _gl_sort_by, NULL); -- 2.7.4