yakov pushed a commit to branch master.

http://git.enlightenment.org/tools/erigo.git/commit/?id=ece4d72ee429dea2ab1ae0200ac4a13f1b0bd789

commit ece4d72ee429dea2ab1ae0200ac4a13f1b0bd789
Author: Yakov Goldberg <yako...@samsung.com>
Date:   Mon Jan 4 19:35:33 2016 +0200

    Add separators support for toolbar
    
    Now separator can be added in Content view.
    It will be properly simulated and code will be generated.
---
 src/bin/gui/prop_layout.c |  5 +++++
 src/lib/ffi_abstraction.c | 11 +++++++++--
 src/lib/generator.c       | 17 +++++++++++++++++
 3 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/src/bin/gui/prop_layout.c b/src/bin/gui/prop_layout.c
index 056fcb2..4ee7109 100644
--- a/src/bin/gui/prop_layout.c
+++ b/src/bin/gui/prop_layout.c
@@ -151,6 +151,11 @@ _proplayout_build_post_cb(const Gui_Widget *wdg, 
It_Data_Type new_type)
                    eo_do(g->main_win->itemview_add_item_nested_but, 
elm_obj_widget_disabled_set(EINA_FALSE));
                    eo_do(g->main_win->itemview_add_separator_but, 
elm_obj_widget_disabled_set(EINA_FALSE));
                 }
+              else if (wdg_is_container(wdg, DB_DEF_TOOLBAR_CLASS))
+                {
+                   eo_do(g->main_win->itemview_add_item_nested_but, 
elm_obj_widget_disabled_set(EINA_TRUE));
+                   eo_do(g->main_win->itemview_add_separator_but, 
elm_obj_widget_disabled_set(EINA_FALSE));
+                }
               else if (wdg_is_container(wdg, DB_DEF_DISKSELECTOR_CLASS) ||
                        wdg_is_container(wdg, DB_DEF_CTXPOPUP_CLASS) ||
                        wdg_is_container(wdg, DB_DEF_TOOLBAR_CLASS) ||
diff --git a/src/lib/ffi_abstraction.c b/src/lib/ffi_abstraction.c
index 835576f..f6d3989 100644
--- a/src/lib/ffi_abstraction.c
+++ b/src/lib/ffi_abstraction.c
@@ -521,8 +521,15 @@ _ffi_eo_item_add(const Gui_Session *session, const 
Gui_Widget *wdg, const Item_C
         Gui_Value *val = prop_value_nth_get(prop, 0);
         wdg_it = *(Item_Container_Item **) gui_value_pointer_get(val);
         parent_it_eo = session_item_get(session, wdg_it);
-        eo_do(eo_cur, ret_item = 
elm_obj_menu_item_separator_add(parent_it_eo));
-        val = prop_value_nth_get(prop, 2);
+        if (!strcmp(wdg_class_name_get(wdg), DB_DEF_MENU_CLASS))
+          {
+             eo_do(eo_cur, ret_item = 
elm_obj_menu_item_separator_add(parent_it_eo));
+          }
+        else if (!strcmp(wdg_class_name_get(wdg), DB_DEF_TOOLBAR_CLASS))
+          {
+             eo_do(eo_cur, ret_item = elm_obj_toolbar_item_append(NULL, NULL, 
NULL, NULL));
+             eo_do(ret_item, elm_obj_toolbar_item_separator_set(EINA_TRUE));
+          }
         return ret_item;
      }
 
diff --git a/src/lib/generator.c b/src/lib/generator.c
index 3c7282c..a10882f 100644
--- a/src/lib/generator.c
+++ b/src/lib/generator.c
@@ -558,6 +558,23 @@ _item_iterate(Gui_Session *session, Widget_Context 
*wdg_ctx, const Gui_Widget *w
         eina_strbuf_append_printf(wdg_ctx->buf, "));\n");
      }
 
+   /* Handle special case when toolbar's item is separator.
+    * Item must be created and then set as separator. */
+   if (!strcmp(class_id, DB_DEF_TOOLBAR_CLASS) &&
+       item_container_item_type_get(wit) == ITEM_SEPARATOR)
+     {
+        if (legacy_name)
+          {
+             if (item_name)
+               eina_strbuf_append_printf(wdg_ctx->buf, "  
elm_toolbar_item_separator_set(%s, EINA_TRUE);\n", item_name);
+          }
+        else
+          {
+             if (item_name)
+               eina_strbuf_append_printf(wdg_ctx->buf, "  eo_do(%s, 
elm_obj_toolbar_item_separator_set(EINA_TRUE));\n", item_name);
+          }
+     }
+
    /* We don't make a widget public if it is created inside a callback, cause 
we don't have any way to
     * store it and return it to the upper layer. */
    if (!wdg_ctx->inside_cb && item_container_item_public_get(wit))

-- 


Reply via email to