diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2019-08-23 14:51:54 -0700 |
---|---|---|
committer | Cedric BAIL <cedric.bail@free.fr> | 2019-08-24 09:28:01 -0700 |
commit | 7f6f707f15a785b1faf28b836c88a9ab831ce615 (patch) | |
tree | f064e5b960e232ccb6798dafd63c9d841ed3e9da | |
parent | 40eff227eb358c35fbe794c579021615337a4ca3 (diff) | |
download | efl-7f6f707f15a785b1faf28b836c88a9ab831ce615.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.
-rw-r--r-- | src/lib/elementary/efl_ui_layout_factory.c | 37 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_layout_factory.eo | 1 |
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 e13971e666..4faa07ecb7 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); + evas_object_size_hint_weight_set(ui_view, EVAS_HINT_EXPAND, 0); + evas_object_size_hint_align_set(ui_view, EVAS_HINT_FILL, EVAS_HINT_FILL); - 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; |