elementary: Efl.Ui.Layout_Factory bind property 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/D9951
This commit is contained in:
Cedric BAIL 2019-08-23 14:51:54 -07:00 committed by Marcel Hollerbach
parent af3f1b070f
commit 3c0b496ad3
2 changed files with 6 additions and 34 deletions

View File

@ -70,48 +70,21 @@ _efl_ui_layout_factory_efl_object_destructor(Eo *obj, Efl_Ui_Layout_Factory_Data
efl_destructor(efl_super(obj, MY_CLASS));
}
static Eina_Value
_efl_ui_layout_factory_bind(Eo *obj EINA_UNUSED, void *data, const Eina_Value value)
{
Efl_Ui_Layout_Factory_Data *pd = data;
Efl_Gfx_Entity *layout;
int len, i;
EINA_VALUE_ARRAY_FOREACH(&value, len, i, layout)
{
eina_hash_foreach(pd->bind.properties, _property_bind, layout);
eina_hash_foreach(pd->bind.factories, _factory_bind, layout);
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
}
return value;
}
static void
_efl_ui_layout_factory_efl_ui_factory_building(const Eo *obj, Efl_Ui_Layout_Factory_Data *pd, Efl_Gfx_Entity *ui_view)
{
if (pd->klass || pd->group || pd->style)
efl_ui_layout_theme_set(ui_view, pd->klass, pd->group, pd->style);
eina_hash_foreach(pd->bind.properties, _property_bind, ui_view);
eina_hash_foreach(pd->bind.factories, _factory_bind, ui_view);
efl_gfx_hint_weight_set(ui_view, EFL_GFX_HINT_EXPAND, 0);
efl_gfx_hint_fill_set(ui_view, EINA_TRUE, EINA_TRUE);
efl_ui_factory_building(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), ui_view);
}
EOLIAN static Eina_Future *
_efl_ui_layout_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Layout_Factory_Data *pd,
Eina_Iterator *models, Efl_Gfx_Entity *parent)
{
Eina_Future *f;
f = efl_ui_factory_create(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), models, parent);
return efl_future_then(obj, f,
.success_type = EINA_VALUE_TYPE_ARRAY,
.success = _efl_ui_layout_factory_bind,
.data = pd);
}
EOLIAN static void
_efl_ui_layout_factory_efl_ui_factory_bind_factory_bind(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Factory_Data *pd,
const char *key, Efl_Ui_Factory *factory)

View File

@ -15,7 +15,6 @@ class @beta Efl.Ui.Layout_Factory extends Efl.Ui.Caching_Factory
implements {
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Ui.Factory.create;
Efl.Ui.Factory.building;
Efl.Ui.Property_Bind.property_bind;
Efl.Ui.Factory_Bind.factory_bind;