evas: Introduce event style_insets,changed for tb
authorJean-Philippe Andre <jp.andre@samsung.com>
Fri, 6 Jan 2017 06:22:54 +0000 (15:22 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 17 Jan 2017 05:35:29 +0000 (14:35 +0900)
This will be triggered in the rare case when a textblock's
insets are changed (ie. the padding due to filters or style).

This fixes invalid sizing in the test case in elm (due to a
lack of event after program_set).

@feature

src/bin/elementary/test_gfx_filters.c
src/lib/evas/canvas/efl_canvas_text.eo
src/lib/evas/canvas/evas_object_textblock.c

index 755405e..299b07d 100644 (file)
@@ -477,6 +477,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
 
       // Experimental textblock support
       o = tb = evas_object_textblock_add(evas_object_evas_get(win));
+      efl_event_callback_add(o, EFL_CANVAS_TEXT_EVENT_STYLE_INSETS_CHANGED, _textblock_resize, NULL);
       efl_event_callback_add(o, EFL_GFX_EVENT_RESIZE, _textblock_resize, NULL);
       Evas_Textblock_Style *st = evas_textblock_style_new();
       evas_textblock_style_set(st, "DEFAULT='font=Sans font_size=20 color=#FFF wrap=word'");
index c018d11..ab69ec9 100644 (file)
@@ -376,5 +376,6 @@ class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Canvas.Filter.Internal)
    }
    events {
       changed; [[Called when the content (text or annotations) changed.]]
+      style_insets,changed; [[Called when the property @.style_insets changed.]]
    }
 }
index 1cd85cd..bfba0b6 100644 (file)
@@ -6387,6 +6387,7 @@ _layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret)
         _paragraphs_clear(eo_obj, c->paragraphs);
         LYDBG("ZZ: ... layout #2\n");
         _layout(eo_obj, w, h, w_ret, h_ret);
+        efl_event_callback_call((Eo *) eo_obj, EFL_CANVAS_TEXT_EVENT_STYLE_INSETS_CHANGED, NULL);
      }
 
    c->o->obstacle_changed = EINA_FALSE;