From f2aef899e09459987d1de46b9ec3f114c6a93a55 Mon Sep 17 00:00:00 2001 From: Vyacheslav Reutskiy Date: Mon, 17 Oct 2016 17:25:43 +0300 Subject: [PATCH] edje_edit: add correct tweens generation for inherit state Change-Id: I639de7b040687e4f21852b4d0c4580f807e5f0e6 Signed-off-by: Vyacheslav Reutskiy --- src/lib/edje/edje_edit.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index 7db9605..45979b9 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -13334,6 +13334,7 @@ _edje_generate_source_state_image(Edje_Edit *eed, Evas_Object *obj, int attr_amount = 0; int indent_space = strlen(I6); char *data; + unsigned int i; Eina_Bool name = EINA_FALSE; Eina_Bool border = EINA_FALSE; @@ -13341,12 +13342,12 @@ _edje_generate_source_state_image(Edje_Edit *eed, Evas_Object *obj, Eina_Bool scale_hint = EINA_FALSE; Eina_Bool border_no_fill = EINA_FALSE; Eina_Bool border_scale = EINA_FALSE; + Eina_Bool tweens = EINA_FALSE; Edje_Part_Description_Image *img; img = (Edje_Part_Description_Image *)pd; Edje_Part_Description_Image *inherit_pd_img = (Edje_Part_Description_Image *)inherit_pd; - ll = edje_edit_state_tweens_list_get(obj, part, state, value); /*TODO: support tweens inherit*/ if (inherit_pd) @@ -13366,7 +13367,19 @@ _edje_generate_source_state_image(Edje_Edit *eed, Evas_Object *obj, border_scale = (img->image.border.scale == inherit_pd_img->image.border.scale) ? EINA_FALSE : EINA_TRUE; - /*Add check for a tween images*/ + if (img->image.tweens_count == inherit_pd_img->image.tweens_count) + { + for (i = 0; i < img->image.tweens_count; i++) + { + if (img->image.tweens[i]->id == inherit_pd_img->image.tweens[i]->id) + continue; + else + { + tweens = EINA_TRUE; + break; + } + } + } } else { @@ -13377,11 +13390,11 @@ _edje_generate_source_state_image(Edje_Edit *eed, Evas_Object *obj, scale_hint = (img->image.scale_hint == EVAS_IMAGE_SCALE_HINT_NONE) ? EINA_FALSE : EINA_TRUE; border_no_fill = (img->image.border.no_fill == 0) ? EINA_FALSE : EINA_TRUE; border_scale = (img->image.border.scale == 0) ? EINA_FALSE : EINA_TRUE; + tweens = (img->image.tweens_count == 0) ? EINA_FALSE : EINA_TRUE; } - attr_amount = name + border + border_scale_by + scale_hint + border_no_fill + border_scale; - attr_amount += (ll == NULL) ? 0 : 2; + attr_amount = name + border + border_scale_by + scale_hint + border_no_fill + border_scale + tweens; if (attr_amount == 0) goto fill; if (attr_amount == 1) @@ -13404,9 +13417,13 @@ _edje_generate_source_state_image(Edje_Edit *eed, Evas_Object *obj, } } - EINA_LIST_FOREACH(ll, l, data) - BUF_APPENDF("%*stween: \"%s\";\n", indent_space, "", data); - edje_edit_string_list_free(ll); + if (tweens) + { + ll = edje_edit_state_tweens_list_get(obj, part, state, value); + EINA_LIST_FOREACH(ll, l, data) + BUF_APPENDF("%*stween: \"%s\";\n", indent_space, "", data); + edje_edit_string_list_free(ll); + } if (border) BUF_APPENDF("%*sborder: %d %d %d %d;\n", indent_space, "", -- 2.7.4