rimmed pushed a commit to branch master.

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

commit fc8d2dae9208c1d61f66c3464efd84817c0a3375
Author: Vitalii Vorobiov <[email protected]>
Date:   Wed Jun 29 13:50:36 2016 +0300

    property_group: style for color_class combobox
---
 data/themes/default/images/color-background-2.png | Bin 0 -> 2888 bytes
 data/themes/default/images/color-shadow-2.png     | Bin 0 -> 2905 bytes
 data/themes/default/widgets/combobox.edc          | 352 ++++++++++++++++++++++
 src/bin/ui/property/property_group.c              |  54 +---
 4 files changed, 356 insertions(+), 50 deletions(-)

diff --git a/data/themes/default/images/color-background-2.png 
b/data/themes/default/images/color-background-2.png
new file mode 100644
index 0000000..a85a986
Binary files /dev/null and b/data/themes/default/images/color-background-2.png 
differ
diff --git a/data/themes/default/images/color-shadow-2.png 
b/data/themes/default/images/color-shadow-2.png
new file mode 100644
index 0000000..99567c0
Binary files /dev/null and b/data/themes/default/images/color-shadow-2.png 
differ
diff --git a/data/themes/default/widgets/combobox.edc 
b/data/themes/default/widgets/combobox.edc
index 6e3e685..0a0fc94 100644
--- a/data/themes/default/widgets/combobox.edc
+++ b/data/themes/default/widgets/combobox.edc
@@ -204,6 +204,358 @@ group { name: "elm/button/base/combobox_vertical/default";
    }
 }
 
+group { name: "elm/button/base/combobox_vertical/color_class";
+   images {
+      image: "dropdown-bg.png" COMP;
+      image: "dropdown-focus-bg.png" COMP;
+      image: "dropdown-bg_unactive.png" COMP;
+      image: "icon-slidedown.png" COMP;
+      image: "icon-slideup.png" COMP;
+      image: "color-background-2.png" COMP;
+      image: "color-shadow-2.png" COMP;
+   }
+   min: 80 19;
+   max: 9999 19;
+   parts {
+      part { name: "base";
+         type: SPACER;
+         description { state: "default" 0.0;
+            max: -1 19;
+         }
+      }
+      part { name: "bg";
+         type: IMAGE;
+         description { state: "default" 0.0;
+            rel1 {
+               to: "base";
+            }
+            rel2 {
+               to: "base";
+            }
+            image {
+               normal: "dropdown-bg.png";
+               border: 3 3 1 1;
+               middle: DEFAULT;
+            }
+         }
+         description { state: "focus" 0.0;
+            rel1 {
+               to: "base";
+            }
+            rel2 {
+               to: "base";
+            }
+            image {
+               normal: "dropdown-focus-bg.png";
+               border: 3 3 1 1;
+               middle: DEFAULT;
+            }
+         }
+         description { state: "disable" 0.0;
+            rel1 {
+               to: "base";
+            }
+            rel2 {
+               to: "base";
+            }
+            image {
+               normal: "dropdown-bg_unactive.png";
+               border: 3 3 1 1;
+               middle: DEFAULT;
+            }
+         }
+      }
+      rect { "icon_clip";
+         desc { "default";
+         }
+         desc { "disabled";
+            inherit: "default";
+            color: 255 255 255 180;
+         }
+      }
+      rect { "event";
+         desc { "default";
+            color: 0 0 0 0;
+         }
+         desc { "disabled";
+            inherit: "default";
+            visible: 0;
+         }
+      }
+      part { name: "left.offset";
+         type: SPACER;
+         description { state: "default" 0.0;
+            align: 0.0 0.0;
+            min: 10 0;
+            max: 10 -1;
+            rel1 {
+               to: "base";
+            }
+            rel2 {
+               to: "base";
+            }
+         }
+      }
+      part { name: "right.offset";
+         type: SPACER;
+         description { state: "default" 0.0;
+            align: 1.0 1.0;
+            min: 20 19;
+            max: 20 -1;
+            rel2 {
+               to: "bg";
+            }
+         }
+      }
+      part { name: "elm.swallow.content";
+         type: SWALLOW;
+         clip_to: "icon_clip";
+         description { state: "default" 0.0;
+            align: 0.0 0.5;
+            rel1 {
+               relative: 1.0 0.0;
+               to_x: "left.offset";
+               to_y: "base";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to_x: "right.offset";
+               to_y: "base";
+            }
+         }
+      }
+      part { name: "select_line";
+         type: IMAGE;
+         description { state: "default" 0.0;
+            max: 6 4;
+            rel1 {
+               to: "right.offset";
+            }
+            rel2 {
+               to: "right.offset";
+            }
+            image {
+               normal: "icon-slidedown.png";
+               middle: DEFAULT;
+            }
+         }
+         description { state: "clicked" 0.0;
+            max: 6 4;
+            rel1 {
+               to: "right.offset";
+            }
+            rel2 {
+               to: "right.offset";
+            }
+            image {
+               normal: "icon-slideup.png";
+               middle: DEFAULT;
+            }
+         }
+         desc { "disabled";
+            inherit: "default";
+         }
+      }
+      part { name: "bg.color3";
+         type: IMAGE;
+         description { state: "default" 0.0;
+            align: 1.0 0.5;
+            min: 16 13;
+            max: 16 13;
+            rel1 {
+               to: "base";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               offset: -7 -1;
+               to_x: "right.offset";
+               to_y: "base";
+            }
+            image {
+               normal: "color-background-2.png";
+               middle: DEFAULT;
+            }
+         }
+      }
+      part { name: "bg.color2";
+         type: IMAGE;
+         description { state: "default" 0.0;
+            align: 1.0 0.5;
+            min: 16 13;
+            max: 16 13;
+            rel1 {
+               to: "base";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               offset: -6 -1;
+               to_x: "bg.color3";
+               to_y: "base";
+            }
+            image {
+               normal: "color-background-2.png";
+               middle: DEFAULT;
+            }
+         }
+      }
+      part { name: "bg.color1";
+         type: IMAGE;
+         description { state: "default" 0.0;
+            align: 1.0 0.5;
+            min: 16 13;
+            max: 16 13;
+            rel1 {
+               to: "base";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               offset: -6 -1;
+               to_x: "bg.color2";
+               to_y: "base";
+            }
+            image {
+               normal: "color-background-2.png";
+               middle: DEFAULT;
+            }
+         }
+      }
+      part { name: "swallow.color1";
+         type: SWALLOW;
+         description { state: "default" 0.0;
+            rel1 {
+               to: "bg.color1";
+            }
+            rel2 {
+               to: "bg.color1";
+            }
+         }
+      }
+      part { name: "swallow.color2";
+         type: SWALLOW;
+         description { state: "default" 0.0;
+            rel1 {
+               to: "bg.color2";
+            }
+            rel2 {
+               to: "bg.color2";
+            }
+         }
+      }
+      part { name: "swallow.color3";
+         type: SWALLOW;
+         description { state: "default" 0.0;
+            rel1 {
+               to: "bg.color3";
+            }
+            rel2 {
+               to: "bg.color3";
+            }
+         }
+      }
+      part { name: "shadow.color1";
+         type: IMAGE;
+         description { state: "default" 0.0;
+            rel1 {
+               to: "bg.color1";
+            }
+            rel2 {
+               to: "bg.color1";
+            }
+            image {
+               normal: "color-shadow-2.png";
+               border: 3 3 3 3;
+               middle: DEFAULT;
+            }
+         }
+      }
+      part { name: "shadow.color2";
+         type: IMAGE;
+         description { state: "default" 0.0;
+            rel1 {
+               to: "bg.color2";
+            }
+            rel2 {
+               to: "bg.color2";
+            }
+            image {
+               normal: "color-shadow-2.png";
+               border: 3 3 3 3;
+               middle: DEFAULT;
+            }
+         }
+      }
+      part { name: "shadow.color3";
+         type: IMAGE;
+         description { state: "default" 0.0;
+            rel1 {
+               to: "bg.color3";
+            }
+            rel2 {
+               to: "bg.color3";
+            }
+            image {
+               normal: "color-shadow-2.png";
+               border: 3 3 3 3;
+               middle: DEFAULT;
+            }
+         }
+      }
+   }
+   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: "icon_clip";
+         target: "event";
+         target: "select_line";
+      }
+      program { name: "button_state_enabled";
+         signal: "elm,state,enabled"; source: "elm";
+         action: STATE_SET "default" 0.0;
+         target: "icon_clip";
+         target: "event";
+         target: "select_line";
+      }
+   }
+}
+
 /* TODO: remove scripts, remake hover */
 group { name: "elm/hover/base/combobox_vertical/default";
    data.item: "dismiss" "on";
diff --git a/src/bin/ui/property/property_group.c 
b/src/bin/ui/property/property_group.c
index ee00856..49573dd 100644
--- a/src/bin/ui/property/property_group.c
+++ b/src/bin/ui/property/property_group.c
@@ -715,50 +715,6 @@ _ccl_control_free(void *data __UNUSED__,
    evas_object_del(color);
 }
 
-
-static void
-_color_class_colors_fill(void *data __UNUSED__,
-                         Evas_Object *combo,
-                         void *event_info __UNUSED__)
-{
-   int cc_val[12];
-   Evas_Object *color;
-   const Eina_List *items, *l;
-   Ewe_Combobox_Item *item;
-   Evas *canvas;
-
-   items = ewe_combobox_items_list_get(combo);
-   if (!items) return;
-
-   item = eina_list_data_get(items);
-   canvas = evas_object_evas_get(item->content);
-   items = eina_list_next(items);
-   EINA_LIST_FOREACH(items, l, item)
-     {
-        edje_edit_color_class_colors_get(EDIT_OBJ, item->title,
-                                         &cc_val[0], &cc_val[1], &cc_val[2], 
&cc_val[3],
-                                         &cc_val[4], &cc_val[5], &cc_val[6], 
&cc_val[7],
-                                         &cc_val[8], &cc_val[9], &cc_val[10], 
&cc_val[11]);
-        evas_color_argb_premul(cc_val[3], &cc_val[0], &cc_val[1], &cc_val[2]);
-        evas_color_argb_premul(cc_val[7], &cc_val[4], &cc_val[5], &cc_val[6]);
-        evas_color_argb_premul(cc_val[11], &cc_val[8], &cc_val[9], 
&cc_val[10]);
-        /* FIXME: this is bad solition, user shoud not use edje object for add 
contnent to a
-         * combobox item. Need to move combobox from edje ocject to layout. */
-        color = edje_object_add(canvas);
-        edje_object_file_set(color, EFLETE_THEME, "elm/image/color/color_set");
-        evas_object_color_set(color, cc_val[0], cc_val[1], cc_val[2], 
cc_val[3]);
-        edje_object_part_swallow(item->content, "swallow.color1", color);
-        color = edje_object_add(canvas);
-        edje_object_file_set(color, EFLETE_THEME, "elm/image/color/color_set");
-        evas_object_color_set(color, cc_val[4], cc_val[5], cc_val[6], 
cc_val[7]);
-        edje_object_part_swallow(item->content, "swallow.color2", color);
-        color = edje_object_add(canvas);
-        edje_object_file_set(color, EFLETE_THEME, "elm/image/color/color_set");
-        evas_object_color_set(color, cc_val[8], cc_val[9], cc_val[10], 
cc_val[11]);
-        edje_object_part_swallow(item->content, "swallow.color3", color);
-     }
-}
-
 static void
 _init_cb(Property_Attribute *pa, Property_Action *action)
 {
@@ -1019,25 +975,24 @@ _init_cb(Property_Attribute *pa, Property_Action *action)
          _fill_combobox_with_enum(action->control, image_border_fill_strings);
          break;
       case ATTRIBUTE_STATE_COLOR_CLASS:
-         ewe_combobox_style_set(action->control, "color_class");
+         elm_object_style_set(action->control, "color_class");
 
          color = elm_image_add(action->control);
          elm_image_file_set(color, EFLETE_THEME, "elm/image/color/color_set");
-         ewe_combobox_content_set(action->control, "swallow.color1", color);
+         elm_object_part_content_set(action->control, "swallow.color1", color);
          evas_object_data_set(action->control, "color1", color);
 
          color = elm_image_add(action->control);
          elm_image_file_set(color, EFLETE_THEME, "elm/image/color/color_set");
-         ewe_combobox_content_set(action->control, "swallow.color2", color);
+         elm_object_part_content_set(action->control, "swallow.color2", color);
          evas_object_data_set(action->control, "color2", color);
 
          color = elm_image_add(action->control);
          elm_image_file_set(color, EFLETE_THEME, "elm/image/color/color_set");
-         ewe_combobox_content_set(action->control, "swallow.color3", color);
+         elm_object_part_content_set(action->control, "swallow.color3", color);
          evas_object_data_set(action->control, "color3", color);
 
          evas_object_event_callback_add(action->control, EVAS_CALLBACK_FREE, 
_ccl_control_free, NULL);
-         evas_object_smart_callback_add(action->control, "expanded", 
_color_class_colors_fill, NULL);
          break;
       default:
          TODO("remove default case after all attributes will be added");
@@ -1245,7 +1200,6 @@ _part_states_combobox_fill(Evas_Object *combo, const char 
*part_name, const char
      }
 }
 
-TODO("Special style for color_class combobox")
 static void
 _color_class_select(Evas_Object *combo, const char *selected)
 {

-- 


Reply via email to