From 0fb8c030c99824d381d410d6048f3885cc779665 Mon Sep 17 00:00:00 2001 From: sachiel Date: Mon, 26 Apr 2010 22:51:24 +0000 Subject: [PATCH] A bit more carefulness when deleting states. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@48352 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/edje_edit.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/edje_edit.c b/src/lib/edje_edit.c index 3aeff2b..4cee6de 100644 --- a/src/lib/edje_edit.c +++ b/src/lib/edje_edit.c @@ -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); -- 2.7.4