A bit more carefulness when deleting states.

SVN revision: 48352
This commit is contained in:
Iván Briano 2010-04-26 22:51:24 +00:00
parent 675bb06b45
commit 53f05ae0e5
1 changed files with 8 additions and 2 deletions

View File

@ -2739,11 +2739,17 @@ edje_edit_state_del(Evas_Object *obj, const char *part, const char *state, doubl
GET_RP_OR_RETURN();
//printf("REMOVE STATE: %s IN PART: %s\n", state, part);
pd = _edje_part_description_find_byname(eed, part, state, value);
if (!pd) return;
/* Don't allow to delete default state, for now at least; */
if (pd == rp->part->default_desc)
return;
/* And if we are deleting the current state, go back to default first */
if (pd == rp->chosen_description)
_edje_part_description_apply(ed, rp, "default", 0.0, NULL, 0.0);
rp->part->other_desc = eina_list_remove(rp->part->other_desc, pd);
_edje_collection_free_part_description_free(pd, 0);