summaryrefslogtreecommitdiff
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
parentacd1c409a02026f550ac61d37573692dc6da680f (diff)
downloadefl-2510f68ff3b71d91941cfd44cf80b17bcbe0ac70.tar.gz
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
-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
_efl_ui_layout_content_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Evas_Object *content)
{
Efl_Ui_Layout_Sub_Object_Data *sub_d;
- const Eina_List *l;
+ Eina_List *l;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@@ -997,6 +997,11 @@ _efl_ui_layout_content_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Ev
* edje_object_part_swallow()'s behavior, then */
else if (content == sub_d->obj)
{
+ sd->subs = eina_list_remove_list(sd->subs, l);
+ _icon_signal_emit(sd, sub_d, EINA_FALSE);
+ eina_stringshare_del(sub_d->part);
+ free(sub_d);
+
_elm_widget_sub_object_redirect_to_top(obj, content);
break;
}
@@ -1015,7 +1020,6 @@ _efl_ui_layout_content_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Ev
_elm_widget_sub_object_redirect_to_top(obj, content);
return EINA_FALSE;
}
-
sub_d = ELM_NEW(Efl_Ui_Layout_Sub_Object_Data);
if (!sub_d)
{
@@ -1086,7 +1090,7 @@ static Evas_Object*
_efl_ui_layout_content_unset(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part)
{
Efl_Ui_Layout_Sub_Object_Data *sub_d;
- const Eina_List *l;
+ Eina_List *l;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
@@ -1112,6 +1116,17 @@ _efl_ui_layout_content_unset(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part)
edje_object_part_unswallow
(wd->resize_obj, content);
+ EINA_LIST_FOREACH(sd->subs, l, sub_d)
+ {
+ if (sub_d->obj == content)
+ {
+ sd->subs = eina_list_remove_list(sd->subs, l);
+ _icon_signal_emit(sd, sub_d, EINA_FALSE);
+ eina_stringshare_del(sub_d->part);
+ free(sub_d);
+ break;
+ }
+ }
_eo_unparent_helper(content, obj);
return content;
}