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.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9950
This commit is contained in:
Cedric BAIL 2019-08-23 14:48:14 -07:00 committed by Marcel Hollerbach
parent 23c24b36a1
commit af3f1b070f
2 changed files with 6 additions and 17 deletions

View File

@ -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)
EOLIAN 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

View File

@ -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;
}
}