summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangHyeon Lee <sh10233.lee@samsung.com>2016-04-01 16:53:57 +0900
committerSangHyeon Lee <sh10233.lee@samsung.com>2016-04-01 16:53:57 +0900
commitc0bbf53cb9b0aa397042b0349476c4642b5b3586 (patch)
tree52b131a39979283afcbdd520c8442555aff89ce6
parentfc2f341e412df4e60a98996f8639fe2b12333be2 (diff)
downloadefl-c0bbf53cb9b0aa397042b0349476c4642b5b3586.tar.gz
support elm_object_item_style_set/get on genlist items
-rw-r--r--src/bin/elementary/test_genlist.c4
-rw-r--r--src/lib/elementary/elm_genlist.c33
-rw-r--r--src/lib/elementary/elm_genlist_item.eo2
3 files changed, 39 insertions, 0 deletions
diff --git a/src/bin/elementary/test_genlist.c b/src/bin/elementary/test_genlist.c
index 4c69be277d..0f8636fb4d 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 d5f56499cd..b5137fc3c7 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 5a966c0afb..fd06afae09 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;