From ce6999557ff702160ba435e8c904703f1326e698 Mon Sep 17 00:00:00 2001 From: raster Date: Tue, 18 Nov 2008 01:46:56 +0000 Subject: [PATCH] and actually force styles to be assigned early. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@37695 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/edje_load.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/lib/edje_load.c b/src/lib/edje_load.c index 0f798a1..1ddcac1 100644 --- a/src/lib/edje_load.c +++ b/src/lib/edje_load.c @@ -586,13 +586,35 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g _edje_unref(ed); ed->load_error = EDJE_LOAD_ERROR_NONE; _edje_emit(ed, "load", NULL); + /* instantiate 'internal swallows' */ + for (i = 0; i < ed->table_parts_size; i++) + { + Edje_Real_Part *rp; + + rp = ed->table_parts[i]; + if ((rp->part->type == EDJE_PART_TYPE_TEXTBLOCK) && + (rp->part->default_desc)) + { + Edje_Style *stl = NULL; + const char *style; + + style = rp->part->default_desc->text.style; + if (style) + { + EINA_LIST_FOREACH(ed->file->styles, l, stl) + { + if ((stl->name) && (!strcmp(stl->name, style))) break; + stl = NULL; + } + } + if (stl) + { + if (evas_object_textblock_style_get(rp->object) != stl->style) + evas_object_textblock_style_set(rp->object, stl->style); + } + } + } } - // this has to be here to textblock works! otherwise textblock objects - // don't have styles. withotu styles textblock doesnt know how to - // convert markup to format nodes+text - so if u append or modify the - // text by appending format or text nodes, you lose the markup as it - // has no idea what to do. this forces at least a style to be applied - edje_object_calc_force(obj); return 1; } else -- 2.7.4