forked from enlightenment/efl
edje: Edje_Edit: fixing text properties setting
Summary: edje_edit_state_text_source_set shouldn't replace existing text. edje_edit_state_text_set should update text in other parts, that are using given part as text.text_source Reviewers: seoz, Hermet, cedric Reviewed By: cedric Subscribers: cedric, reutskiy.v.v Differential Revision: https://phab.enlightenment.org/D1463 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
51a5f852c2
commit
d4f92b987f
|
@ -6427,6 +6427,8 @@ EAPI Eina_Bool
|
||||||
edje_edit_state_text_set(Evas_Object *obj, const char *part, const char *state, double value, const char *text)
|
edje_edit_state_text_set(Evas_Object *obj, const char *part, const char *state, double value, const char *text)
|
||||||
{
|
{
|
||||||
Edje_Part_Description_Text *txt;
|
Edje_Part_Description_Text *txt;
|
||||||
|
Edje_Real_Part *real;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
if (!text)
|
if (!text)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
@ -6442,6 +6444,20 @@ edje_edit_state_text_set(Evas_Object *obj, const char *part, const char *state,
|
||||||
txt->text.text.str = (char *)eina_stringshare_add(text);
|
txt->text.text.str = (char *)eina_stringshare_add(text);
|
||||||
txt->text.text.id = 0;
|
txt->text.text.id = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < ed->table_parts_size; i++)
|
||||||
|
{
|
||||||
|
real = ed->table_parts[i];
|
||||||
|
if (((rp->part->type == EDJE_PART_TYPE_TEXT) ||
|
||||||
|
(rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)) &&
|
||||||
|
(real->typedata.text) && (real->typedata.text->text_source == rp))
|
||||||
|
{
|
||||||
|
txt = (Edje_Part_Description_Text *) real;
|
||||||
|
_edje_if_string_free(ed, txt->text.text.str);
|
||||||
|
txt->text.text.str = (char *)eina_stringshare_add(text);
|
||||||
|
txt->text.text.id = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
edje_object_calc_force(obj);
|
edje_object_calc_force(obj);
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -6912,8 +6928,7 @@ EAPI Eina_Bool
|
||||||
edje_edit_state_text_source_set(Evas_Object *obj, const char *part, const char *state, double value, const char *source)
|
edje_edit_state_text_source_set(Evas_Object *obj, const char *part, const char *state, double value, const char *source)
|
||||||
{
|
{
|
||||||
Edje_Part_Description_Common *spd;
|
Edje_Part_Description_Common *spd;
|
||||||
Edje_Part_Description_Text *txt, *source_style;
|
Edje_Part_Description_Text *txt;
|
||||||
const char *style_source;
|
|
||||||
int id_source;
|
int id_source;
|
||||||
|
|
||||||
GET_PD_OR_RETURN(EINA_FALSE);
|
GET_PD_OR_RETURN(EINA_FALSE);
|
||||||
|
@ -6927,15 +6942,9 @@ edje_edit_state_text_source_set(Evas_Object *obj, const char *part, const char *
|
||||||
spd = _edje_part_description_find_byname(eed, source, state, value);
|
spd = _edje_part_description_find_byname(eed, source, state, value);
|
||||||
if (!spd) return EINA_FALSE;
|
if (!spd) return EINA_FALSE;
|
||||||
txt = (Edje_Part_Description_Text *) pd;
|
txt = (Edje_Part_Description_Text *) pd;
|
||||||
source_style = (Edje_Part_Description_Text *) spd;
|
|
||||||
|
|
||||||
id_source = _edje_part_id_find(ed, source);
|
id_source = _edje_part_id_find(ed, source);
|
||||||
txt->text.id_source = id_source;
|
txt->text.id_source = id_source;
|
||||||
|
|
||||||
style_source = source_style->text.text.str;
|
|
||||||
_edje_if_string_free(ed, txt->text.text.str);
|
|
||||||
txt->text.text.str = eina_stringshare_add(style_source);
|
|
||||||
txt->text.text.id = 0;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue