Elm.Layout: Implement content_remove
authorJean-Philippe Andre <jp.andre@samsung.com>
Mon, 25 Apr 2016 10:53:51 +0000 (19:53 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 26 Apr 2016 05:09:36 +0000 (14:09 +0900)
src/lib/elementary/elm_layout.c
src/lib/elementary/elm_layout.eo

index 9678269..a886bc7 100644 (file)
@@ -1121,6 +1121,23 @@ _elm_layout_efl_container_content_unset(Eo *obj, Elm_Layout_Smart_Data *sd, cons
    return NULL;
 }
 
+EOLIAN static Eina_Bool
+_elm_layout_efl_container_content_remove(Eo *obj, Elm_Layout_Smart_Data *sd EINA_UNUSED,
+                                         Efl_Gfx_Base *content)
+{
+   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+
+   if (!elm_widget_sub_object_del(obj, content))
+     {
+        ERR("could not remove sub object %p from %p", content, obj);
+        return EINA_FALSE;
+     }
+   edje_object_part_unswallow(wd->resize_obj, content);
+   _eo_unparent_helper(content, obj);
+
+   return content;
+}
+
 /* legacy only - eo is iterator */
 EAPI Eina_List *
 elm_layout_content_swallow_list_get(const Evas_Object *obj)
index 4bc7a09..6ec3f8a 100644 (file)
@@ -494,6 +494,7 @@ class Elm.Layout (Elm.Widget, Efl.Container, Efl.File)
       Efl.Container.content_unset;
       Efl.Container.content_part_name.get;
       Efl.Container.content_count;
+      Efl.Container.content_remove;
       Efl.Container.content_iterate;
    }
    events {