evas: Introduce event style_insets,changed for tb

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
This commit is contained in:
Jean-Philippe Andre 2017-01-06 15:22:54 +09:00
parent 40f4acae75
commit 13c62c10e1
3 changed files with 3 additions and 0 deletions

View 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'");

View 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.]]
}
}

View 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;