elm_genlist: Emitting signal when content or text is set in genlist item 09/45509/2
authorJee-Yong Um <jc9.um@samsung.com>
Thu, 7 May 2015 07:21:57 +0000 (16:21 +0900)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Fri, 7 Aug 2015 05:16:27 +0000 (22:16 -0700)
Summary:
There could be a demand for providing subtle different item styles
according to the existence of icon or text swallowed in genlist item.
For example, if icon exists, genlist item shows icon, or show rectangle
where icon should be placed.
One style can have various form with this signal.

Reviewers: Hermet

Subscribers: Hermet

Differential Revision: https://phab.enlightenment.org/D2348

Change-Id: I027da3a97677fc13ab58df7ff7bfd0844aa13ed4
origin: upstream

src/lib/elm_genlist.c

index 8e95473..2e0c06b 100644 (file)
@@ -307,6 +307,7 @@ _item_text_realize(Elm_Gen_Item *it,
    const Eina_List *l;
    const char *key;
    char *s;
+   char buf[256];
 
    if (!it->itc->func.text_get) return;
 
@@ -323,6 +324,9 @@ _item_text_realize(Elm_Gen_Item *it,
           {
              edje_object_part_text_escaped_set(target, key, s);
              free(s);
+
+             snprintf(buf, sizeof(buf), "elm,state,%s,visible", key);
+             edje_object_signal_emit(target, buf, "elm");
           }
         else
           {
@@ -341,6 +345,7 @@ _item_content_realize(Elm_Gen_Item *it,
                       const char *parts)
 {
    Evas_Object *content;
+   char buf[256];
 
    if (!parts)
      {
@@ -383,6 +388,9 @@ _item_content_realize(Elm_Gen_Item *it,
              elm_widget_sub_object_add(WIDGET(it), content);
              if (eo_do(EO_OBJ(it), elm_wdg_item_disabled_get()))
                elm_widget_disabled_set(content, EINA_TRUE);
+
+             snprintf(buf, sizeof(buf), "elm,state,%s,visible", key);
+             edje_object_signal_emit(target, buf, "elm");
           }
      }
 }