diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2019-08-23 14:48:14 -0700 |
---|---|---|
committer | Cedric BAIL <cedric.bail@free.fr> | 2019-08-24 09:28:01 -0700 |
commit | 40eff227eb358c35fbe794c579021615337a4ca3 (patch) | |
tree | 1ab85a2b175b2ce68b90ae438ad84e9fa08c26fa | |
parent | 556352f19d6d8ebbfcbd167c7eebae9d51b25e51 (diff) | |
download | efl-40eff227eb358c35fbe794c579021615337a4ca3.tar.gz |
elementary: Efl.Ui.Image_Factory bind property also during widget creation.
In the same vain as previous patch this will initialize more of the widget during its
creation and reduce unecessary recalc.
-rw-r--r-- | src/lib/elementary/efl_ui_image_factory.c | 22 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_image_factory.eo | 1 |
2 files changed, 6 insertions, 17 deletions
diff --git a/src/lib/elementary/efl_ui_image_factory.c b/src/lib/elementary/efl_ui_image_factory.c index 4d0c139e8b..336a94ac45 100644 --- a/src/lib/elementary/efl_ui_image_factory.c +++ b/src/lib/elementary/efl_ui_image_factory.c @@ -35,34 +35,22 @@ _efl_ui_image_factory_efl_object_destructor(Eo *obj EINA_UNUSED, Efl_Ui_Image_Fa efl_destructor(efl_super(obj, MY_CLASS)); } -static Eina_Value -_efl_ui_image_factory_bind(Eo *obj EINA_UNUSED, void *data, const Eina_Value value) +static void +_efl_ui_image_factory_efl_ui_factory_building(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Factory_Data *pd, Efl_Gfx_Entity *ui_view) { - Efl_Ui_Image_Factory_Data *pd = data; - Efl_Gfx_Entity *entity; - int len, i; + efl_ui_property_bind(ui_view, "filename", pd->property); - EINA_VALUE_ARRAY_FOREACH(&value, len, i, entity) - efl_ui_property_bind(entity, "filename", pd->property); - - return value; + efl_ui_factory_building(efl_super(obj, EFL_UI_IMAGE_FACTORY_CLASS), ui_view); } EOLIAN static Eina_Future * _efl_ui_image_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Image_Factory_Data *pd, Eina_Iterator *models, Efl_Gfx_Entity *parent) { - Eina_Future *f; - if (!parent) return efl_loop_future_rejected(obj, EFL_FACTORY_ERROR_NOT_SUPPORTED); if (!pd->property) return efl_loop_future_rejected(obj, EFL_FACTORY_ERROR_NOT_SUPPORTED); - f = efl_ui_factory_create(efl_super(obj, EFL_UI_IMAGE_FACTORY_CLASS), models, parent); - - return efl_future_then(obj, f, - .success_type = EINA_VALUE_TYPE_ARRAY, - .success = _efl_ui_image_factory_bind, - .data = pd); + return efl_ui_factory_create(efl_super(obj, EFL_UI_IMAGE_FACTORY_CLASS), models, parent); } EOLIAN static Eina_Error diff --git a/src/lib/elementary/efl_ui_image_factory.eo b/src/lib/elementary/efl_ui_image_factory.eo index 5ebcc1cd32..57acc7ea12 100644 --- a/src/lib/elementary/efl_ui_image_factory.eo +++ b/src/lib/elementary/efl_ui_image_factory.eo @@ -5,6 +5,7 @@ class @beta Efl.Ui.Image_Factory extends Efl.Ui.Caching_Factory Efl.Object.constructor; Efl.Object.destructor; Efl.Ui.Factory.create; + Efl.Ui.Factory.building; Efl.Ui.Property_Bind.property_bind; } } |