Edje textblock: Fixed an issue with textblock fit.

Thanks to Brian Wang for reporting this.

SVN revision: 75730
This commit is contained in:
Tom Hacohen 2012-08-27 08:59:11 +00:00
parent dd7d35b1f7
commit b0a19e7d4a
3 changed files with 25 additions and 1 deletions

View File

@ -565,3 +565,7 @@
* Properly destroy color_class and text_class on an Edje_Object.
2012-08-27 Tom Hacohen (TAsn)
* Textblock: Fixed issue with textblock fit not sizing correctly. This
fix is not perfect.

View File

@ -1293,6 +1293,22 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
}
}
static void
_edje_textblock_recalc_apply(Edje *ed, Edje_Real_Part *ep,
Edje_Calc_Params *params,
Edje_Part_Description_Text *chosen_desc)
{
/* FIXME: this is just an hack. */
FLOAT_T sc;
sc = ed->scale;
if (sc == ZERO) sc = _edje_scale;
if (chosen_desc->text.fit_x || chosen_desc->text.fit_y)
{
_edje_part_recalc_single_textblock(sc, ed, ep, chosen_desc, params,
NULL, NULL, NULL, NULL);
}
}
static void
_edje_part_recalc_single_text(FLOAT_T sc __UNUSED__,
Edje *ed,
@ -2941,11 +2957,13 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
case EDJE_PART_TYPE_TABLE:
_edje_table_recalc_apply(ed, ep, pf, (Edje_Part_Description_Table*) chosen_desc);
break;
case EDJE_PART_TYPE_TEXTBLOCK:
_edje_textblock_recalc_apply(ed, ep, pf, (Edje_Part_Description_Text*) chosen_desc);
break;
case EDJE_PART_TYPE_EXTERNAL:
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
case EDJE_PART_TYPE_TEXTBLOCK:
/* Nothing special to do for this type of object. */
break;
case EDJE_PART_TYPE_GRADIENT:

View File

@ -2454,6 +2454,8 @@ _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text)
_anchors_get(en->cursor, rp->object, en);
_edje_emit(rp->edje, "entry,changed", rp->part->name);
_edje_entry_imf_cursor_info_set(en);
_edje_entry_real_part_configure(rp);
#if 0
/* Don't emit cursor changed cause it didn't. It's just init to 0. */
_edje_emit(rp->edje, "cursor,changed", rp->part->name);