summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangHyeon Lee <sh10233.lee@samsung.com>2018-01-12 14:38:23 +0900
committerSangHyeon Lee <sh10233.lee@samsung.com>2018-01-12 14:41:13 +0900
commitf7d9f0dde6b7bf5aae1124682e59373572dd3f90 (patch)
tree714b6d3acec6e60a7c0bb19abebab31e700d8038
parent23624acc16c67698e129da0ae193d4c06300c680 (diff)
gengrid: add visible/hidden signal for texts and contents
Send visible/hidden signal when text/content are realized. This feature is already implemented in genlist widget, for reacting dynamically in item layout depending on their text/content realizations.
-rw-r--r--src/lib/elementary/elm_gengrid.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c
index 7dd31730fc..796298c2ff 100644
--- a/src/lib/elementary/elm_gengrid.c
+++ b/src/lib/elementary/elm_gengrid.c
@@ -991,6 +991,7 @@ _item_text_realize(Elm_Gen_Item *it,
991 const Eina_List *l; 991 const Eina_List *l;
992 const char *key; 992 const char *key;
993 char *s; 993 char *s;
994 char buf[256];
994 995
995 if (!it->itc->func.text_get) return; 996 if (!it->itc->func.text_get) return;
996 997
@@ -1007,10 +1008,16 @@ _item_text_realize(Elm_Gen_Item *it,
1007 { 1008 {
1008 edje_object_part_text_escaped_set(target, key, s); 1009 edje_object_part_text_escaped_set(target, key, s);
1009 free(s); 1010 free(s);
1011
1012 snprintf(buf, sizeof(buf), "elm,state,%s,visible", key);
1013 edje_object_signal_emit(target, buf, "elm");
1010 } 1014 }
1011 else 1015 else
1012 { 1016 {
1013 edje_object_part_text_set(target, key, ""); 1017 edje_object_part_text_set(target, key, "");
1018
1019 snprintf(buf, sizeof(buf), "elm,state,%s,hidden", key);
1020 edje_object_signal_emit(target, buf, "elm");
1014 } 1021 }
1015 if (_elm_config->atspi_mode) 1022 if (_elm_config->atspi_mode)
1016 efl_access_name_changed_signal_emit(EO_OBJ(it)); 1023 efl_access_name_changed_signal_emit(EO_OBJ(it));
@@ -1027,6 +1034,7 @@ _item_content_realize(Elm_Gen_Item *it,
1027 Evas_Object *content; 1034 Evas_Object *content;
1028 Eina_List *source; 1035 Eina_List *source;
1029 const char *key; 1036 const char *key;
1037 char buf[256];
1030 ELM_GENGRID_DATA_GET(it->base->widget, sd); 1038 ELM_GENGRID_DATA_GET(it->base->widget, sd);
1031 1039
1032 if (!parts) 1040 if (!parts)
@@ -1055,7 +1063,12 @@ _item_content_realize(Elm_Gen_Item *it,
1055 if (it->itc->func.content_get) 1063 if (it->itc->func.content_get)
1056 content = it->itc->func.content_get 1064 content = it->itc->func.content_get
1057 ((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), key); 1065 ((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), key);
1058 if (!content) goto out; 1066 if (!content)
1067 {
1068 snprintf(buf, sizeof(buf), "elm,state,%s,hidden", key);
1069 edje_object_signal_emit(target, buf, "elm");
1070 goto out;
1071 }
1059 } 1072 }
1060 eina_hash_add(sd->content_item_map, &content, it->base->eo_obj); 1073 eina_hash_add(sd->content_item_map, &content, it->base->eo_obj);
1061 *contents = eina_list_append(*contents, content); 1074 *contents = eina_list_append(*contents, content);
@@ -1063,9 +1076,16 @@ _item_content_realize(Elm_Gen_Item *it,
1063 { 1076 {
1064 ERR("%s (%p) can not be swallowed into %s", 1077 ERR("%s (%p) can not be swallowed into %s",
1065 evas_object_type_get(content), content, key); 1078 evas_object_type_get(content), content, key);
1079
1080 snprintf(buf, sizeof(buf), "elm,state,%s,hidden", key);
1081 edje_object_signal_emit(target, buf, "elm");
1066 evas_object_del(content); 1082 evas_object_del(content);
1067 goto out; 1083 goto out;
1068 } 1084 }
1085
1086 snprintf(buf, sizeof(buf), "elm,state,%s,visible", key);
1087 edje_object_signal_emit(target, buf, "elm");
1088
1069 if (elm_wdg_item_disabled_get(EO_OBJ(it))) 1089 if (elm_wdg_item_disabled_get(EO_OBJ(it)))
1070 elm_widget_disabled_set(content, EINA_TRUE); 1090 elm_widget_disabled_set(content, EINA_TRUE);
1071 1091