aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/efl_ui_text.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-08-16 15:12:25 -0400
committerCedric BAIL <cedric.bail@free.fr>2019-08-19 16:47:20 -0700
commit409c42e46bc78f54d987be2f7580e4e7ae97942b (patch)
treead0dc897c51097f894534abe288169ab966288d3 /src/lib/elementary/efl_ui_text.c
parentefl_ui/popups: convert from elm_scroller to efl_ui_scroller internally (diff)
downloadefl-409c42e46bc78f54d987be2f7580e4e7ae97942b.tar.gz
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
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/efl_ui_text.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index 6c8a24d36a..631cd1bd0b 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -911,8 +911,17 @@ _efl_ui_text_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Text_Data *sd)
}
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);
- 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.h += edmin.h;
efl_gfx_hint_size_restricted_min_set(obj, min);