rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=406a3fae35b87d1bc297854c0533086219fd0b4d

commit 406a3fae35b87d1bc297854c0533086219fd0b4d
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Thu Mar 31 13:07:31 2016 +0300

    property_demo_swallow: field to set widget content's style
---
 src/bin/ui/property_demo_swallow.c | 33 +++++++++++++++++++++++++++++++++
 src/bin/ui/workspace/demo_group.c  |  4 ++++
 src/bin/ui/workspace/demo_group.h  |  1 +
 3 files changed, 38 insertions(+)

diff --git a/src/bin/ui/property_demo_swallow.c 
b/src/bin/ui/property_demo_swallow.c
index 04fa87c..34766e2 100644
--- a/src/bin/ui/property_demo_swallow.c
+++ b/src/bin/ui/property_demo_swallow.c
@@ -45,6 +45,7 @@ struct _Demo_Swallow_Prop_Data
    Evas_Object *color_obj;
    Evas_Object *picture;
    Evas_Object *widget;
+   Evas_Object *content_style;
 
    Evas_Object *max_w, *max_h;
    Evas_Object *min_w, *min_h;
@@ -324,6 +325,35 @@ prop_image_path_add(Evas_Object *parent,
    return item;
 }
 
+static void
+_on_style_change(void *data,
+                 Evas_Object *obj __UNUSED__,
+                 void *ei __UNUSED__)
+{
+   Demo_Swallow_Prop_Data *pd = (Demo_Swallow_Prop_Data *)data;
+   assert(pd != NULL);
+   const char *value;
+
+   value = elm_entry_entry_get(pd->content_style);
+
+   eina_stringshare_del(pd->part->content_style);
+   pd->part->content_style = eina_stringshare_add(value);
+   pd->part->change = true;
+
+   evas_object_smart_callback_call(ap.win, SIGNAL_DEMO_SWALLOW_SET, pd->part);
+}
+static Evas_Object *
+prop_style_set_add(Evas_Object *parent,
+                   Demo_Swallow_Prop_Data *pd)
+{
+   PROPERTY_ITEM_ADD(parent, "Content Style:", "1swallow")
+   ENTRY_ADD(item, pd->content_style, true)
+   elm_entry_entry_set(pd->content_style, "default");
+   evas_object_smart_callback_add(pd->content_style, "changed,user", 
_on_style_change, pd);
+   elm_layout_content_set(item, NULL, pd->content_style);
+   return item;
+}
+
 void
 ui_property_demo_swallow_part_set(Evas_Object *property, Demo_Part *part)
 {
@@ -339,6 +369,7 @@ ui_property_demo_swallow_part_set(Evas_Object *property, 
Demo_Part *part)
                               part->b,
                               part->a);
         elm_entry_entry_set(pd->picture, part->image_path);
+        elm_entry_entry_set(pd->content_style, part->content_style);
 
         elm_spinner_value_set(pd->min_w, part->min_w);
         elm_spinner_value_set(pd->min_h, part->min_h);
@@ -390,6 +421,8 @@ ui_property_demo_swallow_add(Evas_Object *parent)
    elm_box_pack_end(pd->box, item);
    item = prop_widget_add(pd->box, pd);
    elm_box_pack_end(pd->box, item);
+   item = prop_style_set_add(pd->box, pd);
+   elm_box_pack_end(pd->box, item);
 
    item = prop_rectangle_color_add(pd->box, pd);
    elm_box_pack_end(pd->box, item);
diff --git a/src/bin/ui/workspace/demo_group.c 
b/src/bin/ui/workspace/demo_group.c
index 19bbc20..2a855a6 100644
--- a/src/bin/ui/workspace/demo_group.c
+++ b/src/bin/ui/workspace/demo_group.c
@@ -476,6 +476,7 @@ demo_group_add(Group *group)
              demo_part = mem_calloc(1, sizeof(Demo_Part));
              demo_part->name = eina_stringshare_add(part->name);
              demo_part->type = part->type;
+             demo_part->content_style = eina_stringshare_add("default");
              pl->text_list = eina_list_append(pl->text_list, demo_part);
              elm_genlist_item_append(pl->genlist,
                                      itc_part,
@@ -490,6 +491,7 @@ demo_group_add(Group *group)
              demo_part = mem_calloc(1, sizeof(Demo_Part));
              demo_part->name = eina_stringshare_add(part->name);
              demo_part->type = part->type;
+             demo_part->content_style = eina_stringshare_add("default");
              demo_part->a = 255;
              demo_part->r = 255;
              demo_part->g = 255;
@@ -596,6 +598,7 @@ demo_group_part_add(Evas_Object *demo, Part *part)
         demo_part = mem_calloc(1, sizeof(Demo_Part));
         demo_part->name = eina_stringshare_add(part->name);
         demo_part->type = part->type;
+        demo_part->content_style = eina_stringshare_add("default");
         pl->text_list = eina_list_append(pl->text_list, demo_part);
         elm_genlist_item_append(pl->genlist,
                                 itc_part,
@@ -610,6 +613,7 @@ demo_group_part_add(Evas_Object *demo, Part *part)
         demo_part = mem_calloc(1, sizeof(Demo_Part));
         demo_part->name = eina_stringshare_add(part->name);
         demo_part->type = part->type;
+        demo_part->content_style = eina_stringshare_add("default");
         demo_part->a = 255;
         demo_part->r = 255;
         demo_part->g = 255;
diff --git a/src/bin/ui/workspace/demo_group.h 
b/src/bin/ui/workspace/demo_group.h
index bbd77e5..1b28f8a 100644
--- a/src/bin/ui/workspace/demo_group.h
+++ b/src/bin/ui/workspace/demo_group.h
@@ -100,6 +100,7 @@ struct Demo_Part_
    int swallow_content; /**< type of content (picture, rectangle or widget) */
    int r, g, b, a; /**< color of content */
    int widget; /**< number of widget to be set up */
+   Eina_Stringshare *content_style; /**< number of widget to be set up */
    Eina_Stringshare *image_path; /**< path to image to set up */
    int max_w, max_h, min_w, min_h; /**< object's size */
    Eina_Bool change; /**< in case when content type is changed,

-- 


Reply via email to