elementary: add support for default property on item being created by Efl.Ui.Widget_F...
authorCedric Bail <cedric.bail@free.fr>
Wed, 25 Sep 2019 00:13:49 +0000 (17:13 -0700)
committerJongmin Lee <jm105.lee@samsung.com>
Wed, 25 Sep 2019 21:12:44 +0000 (06:12 +0900)
Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D10129

src/lib/elementary/efl_ui_widget_factory.c

index 00ba103..54b1b8d 100644 (file)
@@ -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);