Ui text: fix size evaluation for default setup
authorDaniel Hirt <daniel.hirt@samsung.com>
Thu, 15 Dec 2016 08:57:59 +0000 (10:57 +0200)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 17 Jan 2017 05:35:30 +0000 (14:35 +0900)
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>
src/lib/elementary/efl_ui_text.c
src/lib/evas/canvas/evas_object_textblock.c

index d241436..0b7860c 100644 (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));
index de3b812..7bd7239 100644 (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 *