summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-08-23 14:51:54 -0700
committerCedric Bail <cedric.bail@free.fr>2019-09-17 20:22:08 -0700
commit2b42b0ad330e5ac628e022a3bc43734dbd6d3763 (patch)
tree436ba5c50fec6cb65293ae1fc34fb53c2127ec5b
parentd7bcd0d0515b66799a95e082be5303c6fddee265 (diff)
downloadefl-2b42b0ad330e5ac628e022a3bc43734dbd6d3763.tar.gz
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. Differential Revision: https://phab.enlightenment.org/D9951
-rw-r--r--src/lib/elementary/efl_ui_layout_factory.c37
-rw-r--r--src/lib/elementary/efl_ui_layout_factory.eo1
2 files changed, 5 insertions, 33 deletions
diff --git a/src/lib/elementary/efl_ui_layout_factory.c b/src/lib/elementary/efl_ui_layout_factory.c
index 58c8235b9e..ed9d975d40 100644
--- a/src/lib/elementary/efl_ui_layout_factory.c
+++ b/src/lib/elementary/efl_ui_layout_factory.c
@@ -70,46 +70,19 @@ _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);
- 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;
+ eina_hash_foreach(pd->bind.properties, _property_bind, ui_view);
+ eina_hash_foreach(pd->bind.factories, _factory_bind, ui_view);
- f = efl_ui_factory_create(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), models, parent);
+ efl_gfx_hint_weight_set(ui_view, EFL_GFX_HINT_EXPAND, 0);
+ efl_gfx_hint_fill_set(ui_view, EINA_TRUE, EINA_TRUE);
- return efl_future_then(obj, f,
- .success_type = EINA_VALUE_TYPE_ARRAY,
- .success = _efl_ui_layout_factory_bind,
- .data = pd);
+ efl_ui_factory_building(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), ui_view);
}
EOLIAN static void
diff --git a/src/lib/elementary/efl_ui_layout_factory.eo b/src/lib/elementary/efl_ui_layout_factory.eo
index d6d473e655..0d35d21706 100644
--- a/src/lib/elementary/efl_ui_layout_factory.eo
+++ b/src/lib/elementary/efl_ui_layout_factory.eo
@@ -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;