forked from enlightenment/efl
edje_edit: fix wrong generation of part's source code (effect field).
There is a static array that is used for parsing the current effect (in Part's struction the effect type is represented by a number) from a number to text. But there is one type of effects (SHADOW) that has a number combined from two types. First four bits are always used for defining the effect's type, but if it is a SHADOW effect, then there is four more bits. They are representing the direction of the shadow in TEXT block. This patch fixes code regeneration after saving edje_edit object, so now it splits the number into two pieces, so we can fully regenerate type of effect. So, in this path: - added static array that represents shadow's direction. - part's source code generaton has been modified. Reviewers: seoz, raster, cedric Reviewed By: cedric CC: reutskiy.v.v, cedric Differential Revision: https://phab.enlightenment.org/D668 Signed-off-by: Cedric BAIL <cedric.bail@free.fr>
This commit is contained in:
parent
85f8661f45
commit
9f5ea9cdae
|
@ -7058,7 +7058,8 @@ edje_edit_script_error_list_get(Evas_Object *obj)
|
|||
}
|
||||
|
||||
static const char *types[] = {"NONE", "RECT", "TEXT", "IMAGE", "SWALLOW", "TEXTBLOCK", "GRADIENT", "GROUP", "BOX", "TABLE", "EXTERNAL", "PROXY", "SPACER"};
|
||||
static const char *effects[] = {"NONE", "PLAIN", "OUTLINE", "SOFT_OUTLINE", "SHADOW", "SOFT_SHADOW", "OUTLINE_SHADOW", "OUTLINE_SOFT_SHADOW ", "FAR_SHADOW ", "FAR_SOFT_SHADOW", "GLOW"};
|
||||
static const char *effects[] = {"NONE", "PLAIN", "OUTLINE", "SOFT_OUTLINE", "SHADOW", "SOFT_SHADOW", "OUTLINE_SHADOW", "OUTLINE_SOFT_SHADOW", "FAR_SHADOW", "FAR_SOFT_SHADOW", "GLOW"};
|
||||
static const char *shadow_direction[] = {"BOTTOM_RIGHT", "BOTTOM", "BOTTOM_LEFT", "LEFT", "TOP_LEFT", "TOP", "TOP_RIGHT", "RIGHT"};
|
||||
static const char *prefers[] = {"NONE", "VERTICAL", "HORIZONTAL", "BOTH"};
|
||||
|
||||
static Eina_Bool
|
||||
|
@ -7807,8 +7808,18 @@ _edje_generate_source_of_part(Evas_Object *obj, Edje_Part *ep, Eina_Strbuf *buf)
|
|||
edje_edit_string_free(str);
|
||||
}
|
||||
if (edje_edit_part_effect_get(obj, part))
|
||||
{
|
||||
int effect = edje_edit_part_effect_get(obj, part);
|
||||
if (effect & EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION)
|
||||
{
|
||||
BUF_APPENDF(I4"effect: %s %s;\n",
|
||||
effects[effect & ~EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION],
|
||||
shadow_direction[effect >> 4]);
|
||||
}
|
||||
else
|
||||
BUF_APPENDF(I4"effect: %s;\n",
|
||||
effects[edje_edit_part_effect_get(obj, part)]);
|
||||
effects[effect]);
|
||||
}
|
||||
|
||||
//Dragable
|
||||
if (edje_edit_part_drag_x_get(obj, part) ||
|
||||
|
|
Loading…
Reference in New Issue