summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-08-23 14:51:54 -0700
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-10 10:06:38 +0200
commit6f4399dbab5cf386d23c16d5f65ccc74590b3f4b (patch)
treeeb872470a186914fa2a3511134e5bba3ff231624
parent7efd1ab292baccbf40b1eadbc823d76212724983 (diff)
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.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..3a0a66d9b2 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
70 efl_destructor(efl_super(obj, MY_CLASS)); 70 efl_destructor(efl_super(obj, MY_CLASS));
71} 71}
72 72
73static Eina_Value
74_efl_ui_layout_factory_bind(Eo *obj EINA_UNUSED, void *data, const Eina_Value value)
75{
76 Efl_Ui_Layout_Factory_Data *pd = data;
77 Efl_Gfx_Entity *layout;
78 int len, i;
79
80 EINA_VALUE_ARRAY_FOREACH(&value, len, i, layout)
81 {
82 eina_hash_foreach(pd->bind.properties, _property_bind, layout);
83 eina_hash_foreach(pd->bind.factories, _factory_bind, layout);
84
85 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 0);
86 evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
87 }
88
89 return value;
90}
91
92static void 73static void
93_efl_ui_layout_factory_efl_ui_factory_building(const Eo *obj, Efl_Ui_Layout_Factory_Data *pd, Efl_Gfx_Entity *ui_view) 74_efl_ui_layout_factory_efl_ui_factory_building(const Eo *obj, Efl_Ui_Layout_Factory_Data *pd, Efl_Gfx_Entity *ui_view)
94{ 75{
95 if (pd->klass || pd->group || pd->style) 76 if (pd->klass || pd->group || pd->style)
96 efl_ui_layout_theme_set(ui_view, pd->klass, pd->group, pd->style); 77 efl_ui_layout_theme_set(ui_view, pd->klass, pd->group, pd->style);
97 78
98 efl_ui_factory_building(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), ui_view); 79 eina_hash_foreach(pd->bind.properties, _property_bind, ui_view);
99} 80 eina_hash_foreach(pd->bind.factories, _factory_bind, ui_view);
100
101EOLIAN static Eina_Future *
102_efl_ui_layout_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Layout_Factory_Data *pd,
103 Eina_Iterator *models, Efl_Gfx_Entity *parent)
104{
105 Eina_Future *f;
106 81
107 f = efl_ui_factory_create(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), models, parent); 82 evas_object_size_hint_weight_set(ui_view, EVAS_HINT_EXPAND, 0);
83 evas_object_size_hint_align_set(ui_view, EVAS_HINT_FILL, EVAS_HINT_FILL);
108 84
109 return efl_future_then(obj, f, 85 efl_ui_factory_building(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), ui_view);
110 .success_type = EINA_VALUE_TYPE_ARRAY,
111 .success = _efl_ui_layout_factory_bind,
112 .data = pd);
113} 86}
114 87
115EOLIAN static void 88EOLIAN 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
15 implements { 15 implements {
16 Efl.Object.constructor; 16 Efl.Object.constructor;
17 Efl.Object.destructor; 17 Efl.Object.destructor;
18 Efl.Ui.Factory.create;
19 Efl.Ui.Factory.building; 18 Efl.Ui.Factory.building;
20 Efl.Ui.Property_Bind.property_bind; 19 Efl.Ui.Property_Bind.property_bind;
21 Efl.Ui.Factory_Bind.factory_bind; 20 Efl.Ui.Factory_Bind.factory_bind;