sanghyeonlee pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c0bbf53cb9b0aa397042b0349476c4642b5b3586
commit c0bbf53cb9b0aa397042b0349476c4642b5b3586 Author: SangHyeon Lee <sh10233....@samsung.com> Date: Fri Apr 1 16:53:57 2016 +0900 support elm_object_item_style_set/get on genlist items --- src/bin/elementary/test_genlist.c | 4 ++++ src/lib/elementary/elm_genlist.c | 33 +++++++++++++++++++++++++++++++++ src/lib/elementary/elm_genlist_item.eo | 2 ++ 3 files changed, 39 insertions(+) diff --git a/src/bin/elementary/test_genlist.c b/src/bin/elementary/test_genlist.c index 4c69be2..0f8636f 100644 --- a/src/bin/elementary/test_genlist.c +++ b/src/bin/elementary/test_genlist.c @@ -35,6 +35,7 @@ enum _api_state SCROLLER_POLICY_SET, TOOLTIP_TEXT_SET, ITEM_CURSOR_SET, + ITEM_STYLE_SET, API_STATE_LAST }; typedef enum _api_state api_state; @@ -92,6 +93,9 @@ set_api_state(api_data *api) elm_genlist_item_cursor_set(elm_genlist_first_item_get(gl), ELM_CURSOR_HAND2); break; + case ITEM_STYLE_SET: /* 8 */ + elm_object_item_style_set(elm_genlist_first_item_get(gl), "double_label"); + break; default: return; } diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c index d5f5649..b5137fc 100644 --- a/src/lib/elementary/elm_genlist.c +++ b/src/lib/elementary/elm_genlist.c @@ -5958,6 +5958,39 @@ _elm_genlist_item_elm_widget_item_signal_emit(Eo *eo_it EINA_UNUSED, Elm_Gen_Ite } EOLIAN static void +_elm_genlist_item_elm_widget_item_style_set(Eo *eo_it, + Elm_Gen_Item *it, + const char *style) +{ + if (it->itc && !strcmp(it->itc->item_style, style)) return; + + Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new(); + + itc->item_style = style; + if (it->itc) + { + itc->func.text_get = it->itc->func.text_get; + itc->func.content_get = it->itc->func.content_get; + itc->func.state_get = it->itc->func.state_get; + itc->func.filter_get = it->itc->func.filter_get; + itc->func.reusable_content_get = it->itc->func.reusable_content_get; + itc->decorate_item_style = it->itc->decorate_item_style; + itc->decorate_all_item_style = it->itc->decorate_all_item_style; + } + + elm_genlist_item_item_class_update(eo_it, itc); + elm_genlist_item_class_free(itc); +} + +EOLIAN static const char * +_elm_genlist_item_elm_widget_item_style_get(Eo *eo_it EINA_UNUSED, + Elm_Gen_Item *it) +{ + if (it->itc) return it->itc->item_style; + else return NULL; +} + +EOLIAN static void _elm_genlist_item_elm_widget_item_focus_set(Eo *eo_it, Elm_Gen_Item *it, Eina_Bool focused) { Evas_Object *obj = WIDGET(it); diff --git a/src/lib/elementary/elm_genlist_item.eo b/src/lib/elementary/elm_genlist_item.eo index 5a966c0..fd06afa 100644 --- a/src/lib/elementary/elm_genlist_item.eo +++ b/src/lib/elementary/elm_genlist_item.eo @@ -422,6 +422,8 @@ class Elm.Genlist_Item(Elm.Widget_Item) Elm.Widget_Item.del_pre; Elm.Widget_Item.disable; Elm.Widget_Item.signal_emit; + Elm.Widget_Item.style.get; + Elm.Widget_Item.style.set; Elm.Widget_Item.focus.set; Elm.Widget_Item.focus.get; Elm.Widget_Item.part_text.get; --