cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=78ee2ca6b0604ddf6ac2479da9585b68ad937613

commit 78ee2ca6b0604ddf6ac2479da9585b68ad937613
Author: Cedric Bail <[email protected]>
Date:   Tue Sep 24 17:13:49 2019 -0700

    elementary: add support for default property on item being created by 
Efl.Ui.Widget_Factory.
    
    Reviewed-by: SangHyeon Jade Lee <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D10129
---
 src/lib/elementary/efl_ui_widget_factory.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/lib/elementary/efl_ui_widget_factory.c 
b/src/lib/elementary/efl_ui_widget_factory.c
index 00ba103cda..54b1b8dc09 100644
--- a/src/lib/elementary/efl_ui_widget_factory.c
+++ b/src/lib/elementary/efl_ui_widget_factory.c
@@ -36,6 +36,8 @@ struct _Efl_Ui_Widget_Factory_Data
 
    Eina_Hash *parts;
 
+   Eina_Stringshare *default_property;
+
    Eina_Stringshare *style;
 };
 
@@ -182,6 +184,9 @@ _efl_ui_widget_factory_releasing(void *data, const 
Efl_Event *ev)
    efl_key_data_set(ui_view, "efl.ui.widget.factory.size_check", NULL);
    if (efl_isa(ui_view, EFL_UI_ITEM_CLASS)) 
efl_ui_item_calc_locked_set(ui_view, EINA_TRUE);
 
+   // Bind default property
+   if (pd->default_property) efl_ui_property_bind(ui_view, NULL, 
pd->default_property);
+
    // Bind all property before the object is finalize
    it = eina_hash_iterator_data_new(pd->parts);
    EINA_ITERATOR_FOREACH(it, bpd)
@@ -405,6 +410,12 @@ 
_efl_ui_property_bind_part_efl_ui_property_bind_property_bind(Eo *obj EINA_UNUSE
         return ENOENT;
      }
 
+   if (!key)
+     {
+        eina_stringshare_replace(&pd->pd->default_property, property);
+        return;
+     }
+
    if (!pd->pd->parts)
      pd->pd->parts = eina_hash_stringshared_new(NULL);
 

-- 


Reply via email to