support elm_object_item_style_set/get on genlist items

This commit is contained in:
SangHyeon Lee 2016-04-01 16:53:57 +09:00
parent fc2f341e41
commit c0bbf53cb9
3 changed files with 39 additions and 0 deletions

View File

@ -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;
}

View File

@ -5957,6 +5957,39 @@ _elm_genlist_item_elm_widget_item_signal_emit(Eo *eo_it EINA_UNUSED, Elm_Gen_Ite
edje_object_signal_emit(it->deco_all_view, emission, source);
}
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)
{

View File

@ -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;