From: Amritanshu Date: Tue, 16 Jun 2020 18:04:09 +0000 (+0530) Subject: Resolve efl-theme 6.0 genlist issue X-Git-Tag: submit/tizen/20200619.124757^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d819fe1059ba7a68c688e63c2a6445db59210fa;p=apps%2Fnative%2Fworldclock-efl.git Resolve efl-theme 6.0 genlist issue Change-Id: I808d74f161880928e96bf43b9d79d13c5a03c262 Signed-off-by: Amritanshu --- diff --git a/inc/worldclock_util.h b/inc/worldclock_util.h index 40f3dac..f88f813 100644 --- a/inc/worldclock_util.h +++ b/inc/worldclock_util.h @@ -20,6 +20,20 @@ #include #include #include "worldclock.h" +#include + +typedef enum { + TIZEN_PROFILE_UNKNOWN = 0, + TIZEN_PROFILE_MOBILE = 0x1, + TIZEN_PROFILE_WEARABLE = 0x2, + TIZEN_PROFILE_TV = 0x4, + TIZEN_PROFILE_IVI = 0x8, + TIZEN_PROFILE_COMMON = 0x10, +} tizen_profile_t; + +extern tizen_profile_t _get_tizen_profile(); +#define _MOBILE (_get_tizen_profile() == TIZEN_PROFILE_MOBILE) +#define _COMMON (_get_tizen_profile() == TIZEN_PROFILE_COMMON) /** * Compare the city name of two cities diff --git a/packaging/worldclock-efl.spec b/packaging/worldclock-efl.spec index 65a0a04..68de199 100644 --- a/packaging/worldclock-efl.spec +++ b/packaging/worldclock-efl.spec @@ -25,6 +25,7 @@ BuildRequires: pkgconfig(tapi) BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(notification) BuildRequires: pkgconfig(capi-appfw-application) +BuildRequires: pkgconfig(capi-system-info) %description This is application for configuration time zone of device diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e4f5dba..807b9d7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,6 +23,7 @@ pkg_check_modules(pkgs REQUIRED notification libtzplatform-config capi-appfw-application + capi-system-info ) FOREACH(flag ${pkgs_CFLAGS}) diff --git a/src/worldclock_add_view.c b/src/worldclock_add_view.c old mode 100644 new mode 100755 index 9b13937..30668e6 --- a/src/worldclock_add_view.c +++ b/src/worldclock_add_view.c @@ -143,6 +143,7 @@ static Elm_Genlist_Item_Class itc_sort = { .func.state_get = NULL, .func.del = NULL, }; + #endif static Elm_Genlist_Item_Class g_ts = { @@ -153,7 +154,6 @@ static Elm_Genlist_Item_Class g_ts = { .func.del = NULL, }; - static void _ugview_clear_data(void *data) { CLK_FUN_BEG(); @@ -596,6 +596,9 @@ Eina_Bool _ugview_genlist_update(void *data) } if (match) { /* append data to genlist */ + if(_COMMON) + g_ts.item_style = "1line"; + gli = elm_genlist_item_append(ad->add_genlist, &g_ts, cs, /* item data */ NULL, /* parent */ ELM_GENLIST_ITEM_NONE, _gl_item_selected_cb, /* func */ @@ -1432,6 +1435,8 @@ static void __ctx_popup_sort_clicked_cb(void *data, Evas_Object *obj, void *even Wcl_Addlist_Sort_Type index = WCL_SORT_BY_NAME; for (index = WCL_SORT_BY_NAME; index < WCL_UNKNOW_SORT_TYPE; index++) { + if(_COMMON) + itc_sort.item_style = "1line"; elm_genlist_item_append(genlist, &itc_sort, (void *)index, NULL, ELM_GENLIST_ITEM_NONE, _sort_gl_clicked_cb, (void *)ad); } diff --git a/src/worldclock_util.c b/src/worldclock_util.c index 7d0e34f..e427ef1 100644 --- a/src/worldclock_util.c +++ b/src/worldclock_util.c @@ -32,6 +32,39 @@ static char *_edgePath = NULL; static char *_localePath = NULL; +tizen_profile_t _get_tizen_profile() +{ + static tizen_profile_t profile = TIZEN_PROFILE_UNKNOWN; + if (__builtin_expect(profile != TIZEN_PROFILE_UNKNOWN, 1)) + return profile; + + char *profileName; + system_info_get_platform_string("http://tizen.org/feature/profile", &profileName); + switch (*profileName) { + case 'm': + case 'M': + profile = TIZEN_PROFILE_MOBILE; + break; + case 'w': + case 'W': + profile = TIZEN_PROFILE_WEARABLE; + break; + case 't': + case 'T': + profile = TIZEN_PROFILE_TV; + break; + case 'i': + case 'I': + profile = TIZEN_PROFILE_IVI; + break; + default: // common or unknown ==> ALL ARE COMMON. + profile = TIZEN_PROFILE_COMMON; + } + + free(profileName); + return profile; +} + /** * Compare the city name of two cities *