summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-09-20 17:31:23 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-09-20 17:32:42 +0900
commit2510f68ff3b71d91941cfd44cf80b17bcbe0ac70 (patch)
tree13dcc63cbc0dd74ba5fc5c6d0ec31bf2c6a0c6f8 /src/lib/elementary
parentacd1c409a02026f550ac61d37573692dc6da680f (diff)
efl ui layout - handle content unset properly and remove the unset item
the content unset in some cases - specifically terminology seems to put the item back in and doesnt remove it... causing it later to be deleted if unset to remove it and re-use it (which is rarely done). @fix
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_layout.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index c0120c6685..9dc63b3aab 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -975,7 +975,7 @@ static Eina_Bool
975_efl_ui_layout_content_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *content) 975_efl_ui_layout_content_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *content)
976{ 976{
977 Efl_Ui_Layout_Sub_Object_Data *sub_d; 977 Efl_Ui_Layout_Sub_Object_Data *sub_d;
978 const Eina_List *l; 978 Eina_List *l;
979 979
980 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); 980 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
981 981
@@ -997,6 +997,11 @@ _efl_ui_layout_content_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Ev
997 * edje_object_part_swallow()'s behavior, then */ 997 * edje_object_part_swallow()'s behavior, then */
998 else if (content == sub_d->obj) 998 else if (content == sub_d->obj)
999 { 999 {
1000 sd->subs = eina_list_remove_list(sd->subs, l);
1001 _icon_signal_emit(sd, sub_d, EINA_FALSE);
1002 eina_stringshare_del(sub_d->part);
1003 free(sub_d);
1004
1000 _elm_widget_sub_object_redirect_to_top(obj, content); 1005 _elm_widget_sub_object_redirect_to_top(obj, content);
1001 break; 1006 break;
1002 } 1007 }
@@ -1015,7 +1020,6 @@ _efl_ui_layout_content_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Ev
1015 _elm_widget_sub_object_redirect_to_top(obj, content); 1020 _elm_widget_sub_object_redirect_to_top(obj, content);
1016 return EINA_FALSE; 1021 return EINA_FALSE;
1017 } 1022 }
1018
1019 sub_d = ELM_NEW(Efl_Ui_Layout_Sub_Object_Data); 1023 sub_d = ELM_NEW(Efl_Ui_Layout_Sub_Object_Data);
1020 if (!sub_d) 1024 if (!sub_d)
1021 { 1025 {
@@ -1086,7 +1090,7 @@ static Evas_Object*
1086_efl_ui_layout_content_unset(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part) 1090_efl_ui_layout_content_unset(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part)
1087{ 1091{
1088 Efl_Ui_Layout_Sub_Object_Data *sub_d; 1092 Efl_Ui_Layout_Sub_Object_Data *sub_d;
1089 const Eina_List *l; 1093 Eina_List *l;
1090 1094
1091 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); 1095 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
1092 1096
@@ -1112,6 +1116,17 @@ _efl_ui_layout_content_unset(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part)
1112 1116
1113 edje_object_part_unswallow 1117 edje_object_part_unswallow
1114 (wd->resize_obj, content); 1118 (wd->resize_obj, content);
1119 EINA_LIST_FOREACH(sd->subs, l, sub_d)
1120 {
1121 if (sub_d->obj == content)
1122 {
1123 sd->subs = eina_list_remove_list(sd->subs, l);
1124 _icon_signal_emit(sd, sub_d, EINA_FALSE);
1125 eina_stringshare_del(sub_d->part);
1126 free(sub_d);
1127 break;
1128 }
1129 }
1115 _eo_unparent_helper(content, obj); 1130 _eo_unparent_helper(content, obj);
1116 return content; 1131 return content;
1117 } 1132 }