forked from enlightenment/efl
efl_ui/text: attempt to size more accurately in non-scroll mode
the internal text object provides a min size based on its current geometry, so temporarily match the geometry of the overall object in order to provide a somewhat more accurate calculation sooner for this object Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D9598
This commit is contained in:
parent
e7cc65bdeb
commit
409c42e46b
|
@ -911,8 +911,17 @@ _efl_ui_text_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Text_Data *sd)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Eina_Size2D text_sz = efl_gfx_entity_size_get(sd->text_obj);
|
||||||
edje_object_size_min_calc(wd->resize_obj, &edmin.w, &edmin.h);
|
edje_object_size_min_calc(wd->resize_obj, &edmin.w, &edmin.h);
|
||||||
efl_canvas_text_size_formatted_get(sd->text_obj, &min.w, &min.h);
|
efl_event_freeze(sd->text_obj);
|
||||||
|
efl_gfx_entity_size_set(sd->text_obj, EINA_SIZE2D(sz.w, 0));
|
||||||
|
/* ignore current object size for single-line since we always need to know the actual size */
|
||||||
|
if (sd->single_line)
|
||||||
|
efl_canvas_text_size_native_get(sd->text_obj, &min.w, &min.h);
|
||||||
|
else
|
||||||
|
efl_canvas_text_size_formatted_get(sd->text_obj, &min.w, &min.h);
|
||||||
|
efl_gfx_entity_size_set(sd->text_obj, text_sz);
|
||||||
|
efl_event_thaw(sd->text_obj);
|
||||||
min.w += edmin.w;
|
min.w += edmin.w;
|
||||||
min.h += edmin.h;
|
min.h += edmin.h;
|
||||||
efl_gfx_hint_size_restricted_min_set(obj, min);
|
efl_gfx_hint_size_restricted_min_set(obj, min);
|
||||||
|
|
Loading…
Reference in New Issue