From: SangHyeon Lee Date: Mon, 22 Jun 2015 08:01:52 +0000 (+0900) Subject: genlist: update genlist style set X-Git-Tag: accepted/tizen/common/20161013.161042~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F05%2F72905%2F5;p=platform%2Fupstream%2Felementary.git genlist: update genlist style set update genlist style set to fallback item/style/default Change-Id: I4d78ecbca9b348c2cc60299dde4adfe2c8e8d418 Signed-off-by: SangHyeon Lee Signed-off-by: jinwoo.shin --- diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index dfec892..434b76a 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -465,12 +465,12 @@ _item_state_realize(Elm_Gen_Item *it, Evas_Object *target, const char *parts) /** * Apply the right style for the created item view. */ -static void -_view_style_update(Elm_Gen_Item *it, Evas_Object *view, const char *style) +// TIZEN_ONLY(20150622): update genlist style set +static Eina_Bool +_view_style_find(Elm_Gen_Item *it, Evas_Object *view, const char *style) { char buf[1024]; - const char *stacking_even; - const char *stacking; + char buf2[1024]; ELM_GENLIST_DATA_GET_FROM_ITEM(it, sd); // FIXME: There exists @@ -506,6 +506,29 @@ _view_style_update(Elm_Gen_Item *it, Evas_Object *view, const char *style) if (!elm_widget_theme_object_set(WIDGET(it), view, "genlist", buf, elm_widget_style_get(WIDGET(it)))) + { + snprintf(buf2, sizeof(buf2), "item/%s", style ? : "default"); + ERR("%s is not a valid genlist item style. fallback to %s", buf, buf2); + if (!strcmp(buf, buf2)) return EINA_FALSE; + if (!elm_widget_theme_object_set(WIDGET(it), view, + "genlist", buf2, + elm_widget_style_get(WIDGET(it)))) + return EINA_FALSE; + } + + return EINA_TRUE; +} +// + +static void +_view_style_update(Elm_Gen_Item *it, Evas_Object *view, const char *style) +{ + const char *stacking_even; + const char *stacking; + + // TIZEN_ONLY(20150622): update genlist style set + if (!_view_style_find(it, view, style)) + // { ERR("%s is not a valid genlist item style. " "Automatically falls back into default style.",