When changing source of a GROUP part, set/clean the swallowed_object, by Thiago Masaki
authorsachiel <sachiel@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 28 Apr 2010 18:40:05 +0000 (18:40 +0000)
committersachiel <sachiel@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 28 Apr 2010 18:40:05 +0000 (18:40 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@48398 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/edje_edit.c

index 4cee6de..00e436f 100644 (file)
@@ -2449,6 +2449,7 @@ edje_edit_part_source_set(Evas_Object *obj, const char *part, const char *source
 {
    GET_RP_OR_RETURN(0);
 
+   Evas_Object *child_obj;
    //printf("Set source for part: %s [source: %s]\n", part, source);
 
    if (rp->part->type == EDJE_PART_TYPE_EXTERNAL)
@@ -2456,8 +2457,19 @@ edje_edit_part_source_set(Evas_Object *obj, const char *part, const char *source
 
    _edje_if_string_free(ed, rp->part->source);
 
+   if (rp->swallowed_object)
+     {
+       _edje_real_part_swallow_clear(rp);
+       evas_object_del(rp->swallowed_object);
+       rp->swallowed_object = NULL;
+     }
    if (source)
-     rp->part->source = eina_stringshare_add(source);
+     {
+       rp->part->source = eina_stringshare_add(source);
+       child_obj = edje_object_add(ed->evas);
+       edje_object_file_set(child_obj, ed->file->path, source);
+       _edje_real_part_swallow(rp, child_obj);
+     }
    else
      rp->part->source = NULL;
    return 1;