summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJee-Yong Um <jc9.um@samsung.com>2015-05-07 16:21:57 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-05-07 17:18:45 +0900
commit26277620c0a073a21d078ef2706c352242b2f89b (patch)
treef160a3ba41490e9f98ab4226da612d64f1147aba
parent6591233227c8e34e4cdc047e09ec62f406c7bcfe (diff)
elm_genlist: Emitting signal when content or text is set in genlist item
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
-rw-r--r--src/lib/elm_genlist.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index f6e66e08b..c41115f22 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -307,6 +307,7 @@ _item_text_realize(Elm_Gen_Item *it,
307 const Eina_List *l; 307 const Eina_List *l;
308 const char *key; 308 const char *key;
309 char *s; 309 char *s;
310 char buf[256];
310 311
311 if (!it->itc->func.text_get) return; 312 if (!it->itc->func.text_get) return;
312 313
@@ -323,6 +324,9 @@ _item_text_realize(Elm_Gen_Item *it,
323 { 324 {
324 edje_object_part_text_escaped_set(target, key, s); 325 edje_object_part_text_escaped_set(target, key, s);
325 free(s); 326 free(s);
327
328 snprintf(buf, sizeof(buf), "elm,state,%s,visible", key);
329 edje_object_signal_emit(target, buf, "elm");
326 } 330 }
327 else 331 else
328 { 332 {
@@ -342,6 +346,7 @@ _item_content_realize(Elm_Gen_Item *it,
342{ 346{
343 Eina_Bool tmp; 347 Eina_Bool tmp;
344 Evas_Object *content; 348 Evas_Object *content;
349 char buf[256];
345 350
346 if (!parts) 351 if (!parts)
347 { 352 {
@@ -384,6 +389,9 @@ _item_content_realize(Elm_Gen_Item *it,
384 elm_widget_sub_object_add(WIDGET(it), content); 389 elm_widget_sub_object_add(WIDGET(it), content);
385 if (eo_do_ret(EO_OBJ(it), tmp, elm_wdg_item_disabled_get())) 390 if (eo_do_ret(EO_OBJ(it), tmp, elm_wdg_item_disabled_get()))
386 elm_widget_disabled_set(content, EINA_TRUE); 391 elm_widget_disabled_set(content, EINA_TRUE);
392
393 snprintf(buf, sizeof(buf), "elm,state,%s,visible", key);
394 edje_object_signal_emit(target, buf, "elm");
387 } 395 }
388 } 396 }
389} 397}