Ui text: fix size evaluation for default setup

Now the size evaluation will query for the native size of the
canvas.text object, and continue with calculations to set the min size
of itself.
This fixes a bug in containers where the widget's size wasn't picked up.

Also, the canvas.text object wasn't reporting 'changed' on text changes.

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
This commit is contained in:
Daniel Hirt 2016-12-15 10:57:59 +02:00 committed by Jean-Philippe Andre
parent 1b881704db
commit 099c1f2d83
2 changed files with 10 additions and 0 deletions

View File

@ -1142,6 +1142,15 @@ _efl_ui_text_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Text_Data *sd)
else
evas_object_size_hint_max_set(obj, -1, -1);
}
else
{
Evas_Coord ominw, ominh;
Eo *sw = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
efl_canvas_text_size_native_get(sw, &resw, &resh);
evas_object_size_hint_min_set(sw, resw, resh);
edje_object_size_min_calc(sd->entry_edje, &ominw, &ominh);
evas_object_size_hint_min_set(obj, ominw, ominh);
}
_cursor_geometry_recalc(obj);
evas_event_thaw(evas_object_evas_get(obj));

View File

@ -14403,6 +14403,7 @@ _efl_canvas_text_efl_text_text_set(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUS
{
evas_object_textblock_text_markup_set(eo_obj, "");
efl_canvas_text_cursor_text_insert(o->cursor, text);
efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL);
}
static char *