rimmed pushed a commit to branch master.

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

commit c17a0a7eabc96f2e8177287243665bedc9d6a2ed
Author: Vitalii Vorobiov <[email protected]>
Date:   Wed Jun 29 19:25:50 2016 +0300

    workspace: use elementary combobox for tizen libraries
---
 data/themes/tizen/images/tool_s_ic_arrow_mv.png  | Bin 0 -> 970 bytes
 data/themes/tizen/images/tool_s_ic_arrow_nor.png | Bin 0 -> 156 bytes
 data/themes/tizen/images/tool_s_ic_arrow_sel.png | Bin 0 -> 156 bytes
 data/themes/tizen/images/tool_s_library_dim.png  | Bin 0 -> 1229 bytes
 data/themes/tizen/images/tool_s_library_mv.png   | Bin 0 -> 1224 bytes
 data/themes/tizen/images/tool_s_library_nor.png  | Bin 0 -> 1237 bytes
 data/themes/tizen/images/tool_s_library_sel.png  | Bin 0 -> 1237 bytes
 data/themes/tizen/widgets/combobox.edc           | 196 +++++++++++++++++++++++
 src/bin/ui/workspace/workspace.c                 |  89 ++++++----
 9 files changed, 253 insertions(+), 32 deletions(-)

diff --git a/data/themes/tizen/images/tool_s_ic_arrow_mv.png 
b/data/themes/tizen/images/tool_s_ic_arrow_mv.png
new file mode 100644
index 0000000..2c9255c
Binary files /dev/null and b/data/themes/tizen/images/tool_s_ic_arrow_mv.png 
differ
diff --git a/data/themes/tizen/images/tool_s_ic_arrow_nor.png 
b/data/themes/tizen/images/tool_s_ic_arrow_nor.png
new file mode 100644
index 0000000..6134da5
Binary files /dev/null and b/data/themes/tizen/images/tool_s_ic_arrow_nor.png 
differ
diff --git a/data/themes/tizen/images/tool_s_ic_arrow_sel.png 
b/data/themes/tizen/images/tool_s_ic_arrow_sel.png
new file mode 100644
index 0000000..8d6b55a
Binary files /dev/null and b/data/themes/tizen/images/tool_s_ic_arrow_sel.png 
differ
diff --git a/data/themes/tizen/images/tool_s_library_dim.png 
b/data/themes/tizen/images/tool_s_library_dim.png
new file mode 100644
index 0000000..5954723
Binary files /dev/null and b/data/themes/tizen/images/tool_s_library_dim.png 
differ
diff --git a/data/themes/tizen/images/tool_s_library_mv.png 
b/data/themes/tizen/images/tool_s_library_mv.png
new file mode 100644
index 0000000..5440d31
Binary files /dev/null and b/data/themes/tizen/images/tool_s_library_mv.png 
differ
diff --git a/data/themes/tizen/images/tool_s_library_nor.png 
b/data/themes/tizen/images/tool_s_library_nor.png
new file mode 100644
index 0000000..17aff03
Binary files /dev/null and b/data/themes/tizen/images/tool_s_library_nor.png 
differ
diff --git a/data/themes/tizen/images/tool_s_library_sel.png 
b/data/themes/tizen/images/tool_s_library_sel.png
new file mode 100644
index 0000000..1e8667f
Binary files /dev/null and b/data/themes/tizen/images/tool_s_library_sel.png 
differ
diff --git a/data/themes/tizen/widgets/combobox.edc 
b/data/themes/tizen/widgets/combobox.edc
index 16f907c..0f33487 100644
--- a/data/themes/tizen/widgets/combobox.edc
+++ b/data/themes/tizen/widgets/combobox.edc
@@ -156,6 +156,202 @@ group { name: "elm/button/base/combobox_vertical/default";
    }
 }
 
+group { name: "elm/button/base/combobox_vertical/library";
+   min: 76 24;
+   max: 9999 24;
+   images {
+      image: "tool_s_ic_arrow_nor.png" COMP;
+      image: "tool_s_ic_arrow_sel.png" COMP;
+      image: "tool_s_ic_arrow_mv.png" COMP;
+      image: "tool_s_library_dim.png" COMP;
+      image: "tool_s_library_mv.png" COMP;
+      image: "tool_s_library_nor.png" COMP;
+      image: "tool_s_library_sel.png" COMP;
+   }
+   parts {
+      part { name: "base";
+         type: SPACER;
+         description { state: "default" 0.0;
+            max: -1 24;
+         }
+      }
+      part { name: "bg0";
+         type: RECT;
+         description { state: "default" 0.0;
+            visible: 0;
+            color: 174 174 174 255;
+         }
+         description { state: "focus" 0.0;
+            inherit: "default" 0.00;
+            visible: 1;
+            color: 5 140 238 255;
+         }
+      }
+      part { name: "left.offset";
+         type: SPACER;
+         description { state: "default" 0.0;
+            align: 0.0 0.0;
+            min: 10 0;
+            max: 10 -1;
+         }
+      }
+      part { name: "bg1";
+         type: RECT;
+         description { state: "default" 0.0;
+         }
+      }
+      part { name: "icon";
+         type: IMAGE;
+         description { state: "default" 0.0;
+            align: 0.0 0.5;
+            min: 20 20;
+            max: 20 20;
+            image.normal: "tool_s_library_nor.png";
+         }
+         description { state: "hovered" 0.0;
+            inherit: "default" 0.00;
+            image.normal: "tool_s_library_mv.png";
+         }
+         description { state: "disabled" 0.0;
+            inherit: "default" 0.00;
+            image.normal: "tool_s_library_dim.png";
+         }
+         description { state: "clicked" 0.0;
+            inherit: "default" 0.00;
+            image.normal: "tool_s_library_sel.png";
+         }
+         description { state: "expanded" 0.0;
+            inherit: "default" 0.00;
+            image.normal: "tool_s_library_sel.png";
+         }
+      }
+      part { name: "right.offset";
+         type: SPACER;
+         description { state: "default" 0.0;
+            align: 1.0 1.0;
+            min: 20 19;
+            max: 20 -1;
+         }
+      }
+      part { name: "select_line";
+         type: IMAGE;
+         clip_to: "disabler";
+         description { state: "default" 0.0;
+            min: 9 9;
+            max: 9 9;
+            image.normal: "tool_s_ic_arrow_nor.png";
+            fill.smooth: 0;
+            rel1.to: "right.offset";
+            rel2.to: "right.offset";
+         }
+         description { state: "expanded" 0.0;
+            inherit: "default" 0.00;
+            image.normal: "tool_s_ic_arrow_sel.png";
+         }
+         description { state: "clicked" 0.0;
+            inherit: "expanded" 0.0;
+         }
+         description { state: "hovered" 0.0;
+            inherit: "default" 0.00;
+            image.normal: "tool_s_ic_arrow_mv.png";
+         }
+      }
+      part { name: "elm.swallow.content";
+         type: SWALLOW;
+         clip_to: "disabler";
+         description { state: "default" 0.0;
+            align: 0.0 0.5;
+            color: 88 88 88 255;
+            min: 65 19;
+            rel1 {
+               relative: 1.0 0.0;
+               offset: 8 0;
+               to_x: "icon";
+            }
+         }
+      }
+      part { name: "expand.btn";
+         type: RECT;
+         description { state: "default" 0.0;
+            color: 0 0 0 0;
+         }
+         description { state: "unvisible" 0.0;
+            inherit: "default" 0.00;
+            visible: 0;
+         }
+      }
+      part { name: "disabler";
+         type: RECT;
+         description { state: "default" 0.0;
+         }
+         description { state: "active" 0.0;
+            inherit: "default" 0.00;
+            color: 64 64 64 225;
+         }
+      }
+      rect { "event";
+         desc { "default";
+            color: 0 0 0 0;
+         }
+         desc { "disabled";
+            inherit: "default";
+            visible: 0;
+         }
+      }
+   }
+   programs {
+      program {
+         signal: "mouse,down,1"; source: "event";
+         action: SIGNAL_EMIT "elm,action,press" "elm";
+         after: "button_click_anim";
+      }
+      program { name: "button_click_anim";
+         action: STATE_SET "clicked" 0.0;
+         target: "base";
+         target: "select_line";
+      }
+      program { name: "button_unclick";
+         signal: "mouse,up,1"; source: "event";
+         action: SIGNAL_EMIT "elm,action,unpress" "elm";
+         after: "button_unclick_anim";
+      }
+      program { name: "button_unclick_anim";
+         action: STATE_SET "default" 0.0;
+         target: "base";
+         target: "select_line";
+      }
+      program { name: "buttonactivate";
+         signal: "elm,anim,activate"; source: "elm";
+         action: STATE_SET "clicked" 0.0;
+         target: "base";
+         target: "select_line";
+         after: "button_unpressed_anim";
+      }
+      program { name: "button_unpressed_anim";
+         action: STATE_SET "default" 0.0;
+         in: 0.5 0.0;
+         target: "base";
+         target: "select_line";
+      }
+      program {
+         signal: "mouse,clicked,1"; source: "event";
+         action: SIGNAL_EMIT "elm,action,click" "elm";
+      }
+      program { name: "button_state_disabled";
+         signal: "elm,state,disabled"; source: "elm";
+         action: STATE_SET "disabled" 0.0;
+         target: "event";
+         target: "disabler";
+      }
+      program { name: "button_state_enabled";
+         signal: "elm,state,enabled"; source: "elm";
+         action: STATE_SET "default" 0.0;
+         target: "event";
+         target: "disabler";
+      }
+   }
+}
+
 group { name: "elm/button/base/combobox_vertical/color_class";
    min: 76 24;
    max: 9999 24;
diff --git a/src/bin/ui/workspace/workspace.c b/src/bin/ui/workspace/workspace.c
index bfd266f..ebd3b97 100644
--- a/src/bin/ui/workspace/workspace.c
+++ b/src/bin/ui/workspace/workspace.c
@@ -41,13 +41,13 @@
 
 #if !HAVE_TIZEN
 static int zoom_values[] = { 20, 50, 100, 200, 500, 0 };
+#endif
 
 typedef struct
 {
    int index;
    Eina_Stringshare *data;
 } Combobox_Item;
-#endif
 
 /* As the workspace can manage the one drag in one time, and only one workspace
  * viewed, we can use the static Change for all workspace */
@@ -111,6 +111,7 @@ struct _Workspace_Data
       } bg_switcher;
 #if HAVE_TIZEN
       Evas_Object *libraries_switcher;
+      Elm_Genlist_Item_Class *libraries_itc;
 #endif
    } toolbar;
    Evas_Object *panes_h; /* for set subobject like code, sequance etc */
@@ -320,21 +321,6 @@ _zoom_controls_disabled_set(Workspace_Data *wd, Eina_Bool 
disabled)
    elm_object_disabled_set(wd->toolbar.zoom.slider, disabled);
 }
 
-#if HAVE_TIZEN
-static void
-_spinner_zoom_cb(void *data,
-                 Evas_Object *obj,
-                 void *event_info __UNUSED__)
-{
-   Workspace_Data *wd = (Workspace_Data *)data;
-
-   double val = elm_spinner_value_get(obj);
-   wd->zoom_factor = val / 100.0;
-   elm_slider_value_set(wd->toolbar.zoom.slider, (int) val);
-
-   _members_zoom_set(wd);
-}
-#else
 static char *
 _combobox_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part 
__UNUSED__)
 {
@@ -351,6 +337,21 @@ _combobox_item_del(void *data,
    free(item);
 }
 
+#if HAVE_TIZEN
+static void
+_spinner_zoom_cb(void *data,
+                 Evas_Object *obj,
+                 void *event_info __UNUSED__)
+{
+   Workspace_Data *wd = (Workspace_Data *)data;
+
+   double val = elm_spinner_value_get(obj);
+   wd->zoom_factor = val / 100.0;
+   elm_slider_value_set(wd->toolbar.zoom.slider, (int) val);
+
+   _members_zoom_set(wd);
+}
+#else
 static void
 _zoom_selected_cb(void *data,
                   Evas_Object *obj __UNUSED__,
@@ -827,12 +828,14 @@ _scroll_area_add(Workspace_Data *wd, Scroll_Area *area, 
Eina_Bool scale_rel)
 
 #if HAVE_TIZEN
 static void
-_library_select(void *data,
-                Evas_Object *obj __UNUSED__,
+_library_select(void *data __UNUSED__,
+                Evas_Object *obj,
                 void *event_info)
 {
-   Workspace_Data *wd = data;
-   Ewe_Combobox_Item *item = event_info;
+   Combobox_Item *item = elm_object_item_data_get(event_info);
+
+   elm_combobox_hover_end(obj);
+   elm_entry_cursor_end_set(obj);
 
    switch (item->index)
      {
@@ -849,8 +852,6 @@ _library_select(void *data,
          colorclass_manager_add();
         break;
      }
-
-   ewe_combobox_text_set(wd->toolbar.libraries_switcher, _("Library"));
 }
 #endif
 
@@ -1199,22 +1200,46 @@ workspace_add(Evas_Object *parent, Group *group)
    tb_it = elm_toolbar_item_append(wd->toolbar.obj, NULL, NULL, NULL, NULL);
    elm_toolbar_item_separator_set(tb_it, true);
 
-
-
 #if HAVE_TIZEN
+   Combobox_Item *combobox_item;
    /* Combobox for a choose libraries. */
-   EWE_COMBOBOX_ADD(wd->toolbar.obj, wd->toolbar.libraries_switcher);
+   COMBOBOX_ADD(wd->toolbar.obj, wd->toolbar.libraries_switcher);
    evas_object_size_hint_min_set(wd->toolbar.libraries_switcher, 95, 0);
-   ewe_combobox_text_set(wd->toolbar.libraries_switcher, _("Library"));
-   ewe_combobox_style_set(wd->toolbar.libraries_switcher, "library");
-   evas_object_smart_callback_add(wd->toolbar.libraries_switcher, "selected", 
_library_select, wd);
+   elm_object_text_set(wd->toolbar.libraries_switcher, _("Library"));
+   elm_object_style_set(wd->toolbar.libraries_switcher, "library");
+   evas_object_smart_callback_add(wd->toolbar.libraries_switcher, 
"item,pressed", _library_select, wd);
    tb_it = elm_toolbar_item_append(wd->toolbar.obj, NULL, NULL, NULL, NULL);
    elm_object_item_part_content_set(tb_it, NULL, 
wd->toolbar.libraries_switcher);
 
-   ewe_combobox_item_add(wd->toolbar.libraries_switcher, "Image");
-   ewe_combobox_item_add(wd->toolbar.libraries_switcher, "Sound");
-   ewe_combobox_item_add(wd->toolbar.libraries_switcher, "Textblock styles");
-   ewe_combobox_item_add(wd->toolbar.libraries_switcher, "Color classes");
+   wd->toolbar.libraries_itc = elm_genlist_item_class_new();
+   wd->toolbar.libraries_itc->item_style = "default";
+   wd->toolbar.libraries_itc->func.text_get = _combobox_text_get;
+   wd->toolbar.libraries_itc->func.del = _combobox_item_del;
+
+   combobox_item = mem_malloc(sizeof(Combobox_Item));
+   combobox_item->data = eina_stringshare_add("Image");
+   combobox_item->index = 0;
+   elm_genlist_item_append(wd->toolbar.libraries_switcher, 
wd->toolbar.libraries_itc,
+                           combobox_item, NULL,
+                           ELM_GENLIST_ITEM_NONE, NULL, NULL);
+   combobox_item = mem_malloc(sizeof(Combobox_Item));
+   combobox_item->data = eina_stringshare_add("Sound");
+   combobox_item->index = 1;
+   elm_genlist_item_append(wd->toolbar.libraries_switcher, 
wd->toolbar.libraries_itc,
+                           combobox_item, NULL,
+                           ELM_GENLIST_ITEM_NONE, NULL, NULL);
+   combobox_item = mem_malloc(sizeof(Combobox_Item));
+   combobox_item->data = eina_stringshare_add("Textblock");
+   combobox_item->index = 2;
+   elm_genlist_item_append(wd->toolbar.libraries_switcher, 
wd->toolbar.libraries_itc,
+                           combobox_item, NULL,
+                           ELM_GENLIST_ITEM_NONE, NULL, NULL);
+   combobox_item = mem_malloc(sizeof(Combobox_Item));
+   combobox_item->data = eina_stringshare_add("ColorClasses");
+   combobox_item->index = 3;
+   elm_genlist_item_append(wd->toolbar.libraries_switcher, 
wd->toolbar.libraries_itc,
+                           combobox_item, NULL,
+                           ELM_GENLIST_ITEM_NONE, NULL, NULL);
    tb_it = elm_toolbar_item_append(wd->toolbar.obj, NULL, NULL, NULL, NULL);
    elm_toolbar_item_separator_set(tb_it, true);
 #endif

-- 


Reply via email to