rimmed pushed a commit to branch master.

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

commit ec3e776f3fe8d4a54bd2ebbad5f3b95e1d1f8d34
Author: Andrii Kroitor <an.kroi...@samsung.com>
Date:   Wed Mar 16 10:05:28 2016 +0200

    property_style: fix shadow direction
    
    Fixes T3211
---
 data/themes/default/images/direction-arrow-b.png   | Bin 161 -> 0 bytes
 data/themes/default/images/direction-arrow-bl.png  | Bin 158 -> 0 bytes
 data/themes/default/images/direction-arrow-br.png  | Bin 160 -> 0 bytes
 data/themes/default/images/direction-arrow-l.png   | Bin 145 -> 0 bytes
 data/themes/default/images/direction-arrow-r.png   | Bin 148 -> 0 bytes
 data/themes/default/images/direction-arrow-t.png   | Bin 153 -> 0 bytes
 data/themes/default/images/direction-arrow-tl.png  | Bin 155 -> 0 bytes
 data/themes/default/images/direction-arrow-tr.png  | Bin 156 -> 0 bytes
 .../default/images/direction-bg-b-clicked.png      | Bin 143 -> 0 bytes
 .../default/images/direction-bg-b-selected.png     | Bin 155 -> 0 bytes
 data/themes/default/images/direction-bg-b.png      | Bin 151 -> 0 bytes
 .../default/images/direction-bg-bl-clicked.png     | Bin 171 -> 0 bytes
 .../default/images/direction-bg-bl-selected.png    | Bin 185 -> 0 bytes
 data/themes/default/images/direction-bg-bl.png     | Bin 179 -> 0 bytes
 .../default/images/direction-bg-br-clicked.png     | Bin 167 -> 0 bytes
 .../default/images/direction-bg-br-selected.png    | Bin 182 -> 0 bytes
 data/themes/default/images/direction-bg-br.png     | Bin 176 -> 0 bytes
 .../default/images/direction-bg-l-clicked.png      | Bin 148 -> 0 bytes
 .../default/images/direction-bg-l-selected.png     | Bin 164 -> 0 bytes
 data/themes/default/images/direction-bg-l.png      | Bin 158 -> 0 bytes
 .../default/images/direction-bg-r-clicked.png      | Bin 148 -> 0 bytes
 .../default/images/direction-bg-r-selected.png     | Bin 164 -> 0 bytes
 data/themes/default/images/direction-bg-r.png      | Bin 158 -> 0 bytes
 .../default/images/direction-bg-t-clicked.png      | Bin 143 -> 0 bytes
 .../default/images/direction-bg-t-selected.png     | Bin 155 -> 0 bytes
 data/themes/default/images/direction-bg-t.png      | Bin 151 -> 0 bytes
 .../default/images/direction-bg-tl-clicked.png     | Bin 188 -> 0 bytes
 .../default/images/direction-bg-tl-selected.png    | Bin 189 -> 0 bytes
 data/themes/default/images/direction-bg-tl.png     | Bin 192 -> 0 bytes
 .../default/images/direction-bg-tr-clicked.png     | Bin 186 -> 0 bytes
 .../default/images/direction-bg-tr-selected.png    | Bin 195 -> 0 bytes
 data/themes/default/images/direction-bg-tr.png     | Bin 194 -> 0 bytes
 data/themes/default/widgets/radio.edc              |  98 ---------------------
 src/bin/ui/property_style.c                        |  94 +++++++-------------
 34 files changed, 31 insertions(+), 161 deletions(-)

diff --git a/data/themes/default/images/direction-arrow-b.png 
b/data/themes/default/images/direction-arrow-b.png
deleted file mode 100644
index a55c5f9..0000000
Binary files a/data/themes/default/images/direction-arrow-b.png and /dev/null 
differ
diff --git a/data/themes/default/images/direction-arrow-bl.png 
b/data/themes/default/images/direction-arrow-bl.png
deleted file mode 100644
index 63c8188..0000000
Binary files a/data/themes/default/images/direction-arrow-bl.png and /dev/null 
differ
diff --git a/data/themes/default/images/direction-arrow-br.png 
b/data/themes/default/images/direction-arrow-br.png
deleted file mode 100644
index d0a829c..0000000
Binary files a/data/themes/default/images/direction-arrow-br.png and /dev/null 
differ
diff --git a/data/themes/default/images/direction-arrow-l.png 
b/data/themes/default/images/direction-arrow-l.png
deleted file mode 100644
index 947dbf9..0000000
Binary files a/data/themes/default/images/direction-arrow-l.png and /dev/null 
differ
diff --git a/data/themes/default/images/direction-arrow-r.png 
b/data/themes/default/images/direction-arrow-r.png
deleted file mode 100644
index 15a894b..0000000
Binary files a/data/themes/default/images/direction-arrow-r.png and /dev/null 
differ
diff --git a/data/themes/default/images/direction-arrow-t.png 
b/data/themes/default/images/direction-arrow-t.png
deleted file mode 100644
index 9d6233a..0000000
Binary files a/data/themes/default/images/direction-arrow-t.png and /dev/null 
differ
diff --git a/data/themes/default/images/direction-arrow-tl.png 
b/data/themes/default/images/direction-arrow-tl.png
deleted file mode 100644
index e19e9ad..0000000
Binary files a/data/themes/default/images/direction-arrow-tl.png and /dev/null 
differ
diff --git a/data/themes/default/images/direction-arrow-tr.png 
b/data/themes/default/images/direction-arrow-tr.png
deleted file mode 100644
index 7efca30..0000000
Binary files a/data/themes/default/images/direction-arrow-tr.png and /dev/null 
differ
diff --git a/data/themes/default/images/direction-bg-b-clicked.png 
b/data/themes/default/images/direction-bg-b-clicked.png
deleted file mode 100644
index 5190550..0000000
Binary files a/data/themes/default/images/direction-bg-b-clicked.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-b-selected.png 
b/data/themes/default/images/direction-bg-b-selected.png
deleted file mode 100644
index 2ad4e58..0000000
Binary files a/data/themes/default/images/direction-bg-b-selected.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-b.png 
b/data/themes/default/images/direction-bg-b.png
deleted file mode 100644
index 629c3c0..0000000
Binary files a/data/themes/default/images/direction-bg-b.png and /dev/null 
differ
diff --git a/data/themes/default/images/direction-bg-bl-clicked.png 
b/data/themes/default/images/direction-bg-bl-clicked.png
deleted file mode 100644
index d4a0633..0000000
Binary files a/data/themes/default/images/direction-bg-bl-clicked.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-bl-selected.png 
b/data/themes/default/images/direction-bg-bl-selected.png
deleted file mode 100644
index 187e1ec..0000000
Binary files a/data/themes/default/images/direction-bg-bl-selected.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-bl.png 
b/data/themes/default/images/direction-bg-bl.png
deleted file mode 100644
index 5e4227c..0000000
Binary files a/data/themes/default/images/direction-bg-bl.png and /dev/null 
differ
diff --git a/data/themes/default/images/direction-bg-br-clicked.png 
b/data/themes/default/images/direction-bg-br-clicked.png
deleted file mode 100644
index 86358d1..0000000
Binary files a/data/themes/default/images/direction-bg-br-clicked.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-br-selected.png 
b/data/themes/default/images/direction-bg-br-selected.png
deleted file mode 100644
index b5b8e14..0000000
Binary files a/data/themes/default/images/direction-bg-br-selected.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-br.png 
b/data/themes/default/images/direction-bg-br.png
deleted file mode 100644
index b48646e..0000000
Binary files a/data/themes/default/images/direction-bg-br.png and /dev/null 
differ
diff --git a/data/themes/default/images/direction-bg-l-clicked.png 
b/data/themes/default/images/direction-bg-l-clicked.png
deleted file mode 100644
index da01296..0000000
Binary files a/data/themes/default/images/direction-bg-l-clicked.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-l-selected.png 
b/data/themes/default/images/direction-bg-l-selected.png
deleted file mode 100644
index edc17d1..0000000
Binary files a/data/themes/default/images/direction-bg-l-selected.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-l.png 
b/data/themes/default/images/direction-bg-l.png
deleted file mode 100644
index 392e642..0000000
Binary files a/data/themes/default/images/direction-bg-l.png and /dev/null 
differ
diff --git a/data/themes/default/images/direction-bg-r-clicked.png 
b/data/themes/default/images/direction-bg-r-clicked.png
deleted file mode 100644
index da01296..0000000
Binary files a/data/themes/default/images/direction-bg-r-clicked.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-r-selected.png 
b/data/themes/default/images/direction-bg-r-selected.png
deleted file mode 100644
index edc17d1..0000000
Binary files a/data/themes/default/images/direction-bg-r-selected.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-r.png 
b/data/themes/default/images/direction-bg-r.png
deleted file mode 100644
index 7ee0e91..0000000
Binary files a/data/themes/default/images/direction-bg-r.png and /dev/null 
differ
diff --git a/data/themes/default/images/direction-bg-t-clicked.png 
b/data/themes/default/images/direction-bg-t-clicked.png
deleted file mode 100644
index 5190550..0000000
Binary files a/data/themes/default/images/direction-bg-t-clicked.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-t-selected.png 
b/data/themes/default/images/direction-bg-t-selected.png
deleted file mode 100644
index 2ad4e58..0000000
Binary files a/data/themes/default/images/direction-bg-t-selected.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-t.png 
b/data/themes/default/images/direction-bg-t.png
deleted file mode 100644
index 629c3c0..0000000
Binary files a/data/themes/default/images/direction-bg-t.png and /dev/null 
differ
diff --git a/data/themes/default/images/direction-bg-tl-clicked.png 
b/data/themes/default/images/direction-bg-tl-clicked.png
deleted file mode 100644
index 93ce069..0000000
Binary files a/data/themes/default/images/direction-bg-tl-clicked.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-tl-selected.png 
b/data/themes/default/images/direction-bg-tl-selected.png
deleted file mode 100644
index a3faa46..0000000
Binary files a/data/themes/default/images/direction-bg-tl-selected.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-tl.png 
b/data/themes/default/images/direction-bg-tl.png
deleted file mode 100644
index 9d3f9c8..0000000
Binary files a/data/themes/default/images/direction-bg-tl.png and /dev/null 
differ
diff --git a/data/themes/default/images/direction-bg-tr-clicked.png 
b/data/themes/default/images/direction-bg-tr-clicked.png
deleted file mode 100644
index 11ae6ad..0000000
Binary files a/data/themes/default/images/direction-bg-tr-clicked.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-tr-selected.png 
b/data/themes/default/images/direction-bg-tr-selected.png
deleted file mode 100644
index b8b54d9..0000000
Binary files a/data/themes/default/images/direction-bg-tr-selected.png and 
/dev/null differ
diff --git a/data/themes/default/images/direction-bg-tr.png 
b/data/themes/default/images/direction-bg-tr.png
deleted file mode 100644
index 073ca10..0000000
Binary files a/data/themes/default/images/direction-bg-tr.png and /dev/null 
differ
diff --git a/data/themes/default/widgets/radio.edc 
b/data/themes/default/widgets/radio.edc
index 8f61992..2b09150 100644
--- a/data/themes/default/widgets/radio.edc
+++ b/data/themes/default/widgets/radio.edc
@@ -744,101 +744,3 @@ WORKSPACE_RADIO("separate", "separate.png")
 WORKSPACE_RADIO("animator", "animator.png")
 WORKSPACE_RADIO("code", "code.png")
 WORKSPACE_RADIO("demo", "demo.png")
-
-#define DIRECTION_ADD(DIRECT) \
-group { name: "elm/radio/base/"DIRECT; \
-   images{ \
-      image: "direction-arrow-"DIRECT".png" COMP; \
-      image: "direction-bg-"DIRECT".png" COMP; \
-      image: "direction-bg-"DIRECT"-clicked.png" COMP; \
-      image: "direction-bg-"DIRECT"-selected.png" COMP; \
-   } \
-   parts { \
-      part { name: "radio"; \
-         type: IMAGE; \
-         description { state: "default" 0; \
-            visible: 1; \
-            rel2.offset: -1 -1; \
-            image { \
-               normal: "direction-bg-"DIRECT".png"; \
-               border: 3 3 3 3; \
-               middle: SOLID; \
-            } \
-         } \
-         description { state: "clicked" 0; \
-            inherit: "default" 0.0; \
-            image.normal: "direction-bg-"DIRECT"-clicked.png"; \
-         } \
-         description { state: "selected" 0; \
-            inherit: "default" 0.0; \
-            image { \
-               normal: "direction-bg-"DIRECT"-selected.png"; \
-               border: 4 4 4 4; \
-            } \
-            fill.smooth : 0; \
-         } \
-      } \
-      part { name: "arrow_image"; \
-         type: IMAGE; \
-         mouse_events: 1; \
-         repeat_events: 1; \
-         description { state: "default" 0; \
-            min: 7 7; \
-            max: 7 7; \
-            image { \
-               normal: "direction-arrow-"DIRECT".png"; \
-               middle: SOLID; \
-            } \
-         } \
-      } \
-      part { name: "events"; \
-         type: RECT; \
-         ignore_flags: ON_HOLD; \
-         description { state: "default" 0.0; \
-            color: 0 0 0 0; \
-        } \
-      } \
-   } \
-   programs { \
-      program { name: "press"; \
-         signal: "mouse,down,1"; \
-         source: "events"; \
-         action:  STATE_SET "clicked" 0.0; \
-         target: "radio"; \
-      } \
-      program { name: "unpress"; \
-         signal: "mouse,up,1"; \
-         source: "events"; \
-         action:  STATE_SET "selected" 0.0; \
-         target: "radio"; \
-      } \
-      program { name: "click"; \
-         signal: "mouse,up,1"; \
-         source: "events"; \
-         action: SIGNAL_EMIT "elm,action,radio,toggle" ""; \
-      } \
-      program { name: "radio_on"; \
-         signal: "elm,state,radio,on"; \
-         source: "elm"; \
-         action:  STATE_SET "selected" 0.0; \
-         target: "radio"; \
-      } \
-      program { name: "radio_off"; \
-         signal: "elm,state,radio,off"; \
-         source: "elm"; \
-         action:  STATE_SET "default" 0.0; \
-         target: "radio"; \
-      } \
-   } \
-}
-
-DIRECTION_ADD("bl")
-DIRECTION_ADD("b")
-DIRECTION_ADD("br")
-DIRECTION_ADD("l")
-DIRECTION_ADD("r")
-DIRECTION_ADD("tl")
-DIRECTION_ADD("t")
-DIRECTION_ADD("tr")
-
-#undef DIRECTION_ADD
diff --git a/src/bin/ui/property_style.c b/src/bin/ui/property_style.c
index 9af80d8..03d1115 100644
--- a/src/bin/ui/property_style.c
+++ b/src/bin/ui/property_style.c
@@ -53,7 +53,7 @@ struct _Style_Prop_Data
    Evas_Object *outer_gl_color;
    Evas_Object *inner_gl_color;
    Evas_Object *shadow_color;
-   Evas_Object *direction[8];
+   Evas_Object *direction;
    Evas_Object *box_glow_shadow;
    //Lines frame data
    Evas_Object *check_s_color;
@@ -911,17 +911,37 @@ _add_inner_outer_part(Style_Prop_Data *pd)
                                   _on_inner_gl_color_clicked, pd);
 }
 
+static void
+_on_select_direction(void *data,
+                     Evas_Object *obj __UNUSED__,
+                     void *event_info)
+{
+   Ewe_Combobox_Item *it = event_info;
+   Style_Prop_Data *pd = data;
+
+   assert(pd != NULL);
+
+   eina_stringshare_del(style_table[DIRECTION_NUM][1]);
+   style_table[DIRECTION_NUM][1] = eina_stringshare_add(it->title);
+   _tag_parse(pd, it->title, "direction");
+   _style_edit_update(pd);
+}
+
 static Evas_Object *
-_add_direction_item(Evas_Object *parent)
+_add_direction_item(Evas_Object *parent, Style_Prop_Data *pd)
 {
-   Evas_Object *item_direction = elm_layout_add(parent);
-   elm_layout_theme_set(item_direction, "layout", "style_editor", "direction");
-   evas_object_show(item_direction);
-   PROPERTY_ITEM_ADD(parent, _("direction"), "1swallow_direction")
-   elm_layout_content_set(item, NULL, item_direction);
+   int i;
+
+   pd->direction = ewe_combobox_add(parent);
+   evas_object_smart_callback_add(pd->direction, "selected", 
_on_select_direction, pd);
+   evas_object_show(pd->direction);
+   PROPERTY_ITEM_ADD(parent, _("direction"), "1swallow")
+   elm_layout_content_set(item, NULL, pd->direction);
    elm_box_pack_end(parent, item);
+   for(i = 0; direction_list[i] != NULL; i++)
+     ewe_combobox_item_add(pd->direction, direction_list[i]);
 
-   return item_direction;
+   return pd->direction;
 }
 
 static Evas_Object *
@@ -934,7 +954,7 @@ _add_shadow_part(Style_Prop_Data *pd)
    evas_object_event_callback_add(pd->shadow_color, EVAS_CALLBACK_MOUSE_DOWN,
                                   _on_shadow_color_clicked, pd);
 
-   return _add_direction_item(pd->box_glow_shadow);
+   return _add_direction_item(pd->box_glow_shadow, pd);
 }
 
 static void
@@ -1064,41 +1084,6 @@ _position_text_option_update(Style_Prop_Data *pd, const 
char *value)
      }
 }
 
-#define DIRECT_ADD(VALUE, TEXT, STYLE, VAL) \
-static void \
-_on_##VALUE##_select_direction(void *data, \
-                              Evas_Object *obj __UNUSED__, \
-                              void *event_info __UNUSED__) \
-{ \
-   Style_Prop_Data *pd = data; \
-   assert(pd != NULL); \
-   style_table[DIRECTION_NUM][1] = eina_stringshare_add(TEXT); \
-   _tag_parse(pd, TEXT, "direction"); \
-   _style_edit_update(pd); \
-} \
-static Evas_Object * \
-_direction_item_##VALUE##_add(Evas_Object *item, Style_Prop_Data *pd) \
-{ \
-   Evas_Object *widget; \
-\
-   assert(pd != NULL); \
-   RADIO_ADD(item, widget, VAL, ""); \
-   elm_object_style_set(widget, STYLE); \
-   elm_object_part_content_set(item, "swallow."TEXT, widget); \
-   evas_object_smart_callback_add(widget, "focused", 
_on_##VALUE##_select_direction, pd); \
-   return widget; \
-}
-
-
-DIRECT_ADD(bl,"bottom_left", "bl", 0)
-DIRECT_ADD(b, "bottom", "b", 1)
-DIRECT_ADD(br, "bottom_right", "br", 2)
-DIRECT_ADD(l, "left", "l", 3)
-DIRECT_ADD(r, "right", "r", 4)
-DIRECT_ADD(tl, "top_left", "tl", 5)
-DIRECT_ADD(t, "top", "t", 6)
-DIRECT_ADD(tr, "top_right", "tr", 7)
-
 static Eina_Bool
 _check_value(const char *list[], const char *value)
 {
@@ -1124,7 +1109,6 @@ _glow_shadow_prop_update(Style_Prop_Data *pd, const char 
*value)
    unsigned int i = 0;
    char *style_copy = NULL;
    char *token;
-   Evas_Object *item;
    int count = 0, direction = DEFAULT_DIRECTION;
 
    if (value)
@@ -1183,28 +1167,12 @@ _glow_shadow_prop_update(Style_Prop_Data *pd, const 
char *value)
 
         if (strstr(style, "shadow"))
           {
-             item = _add_shadow_part(pd);
+             _add_shadow_part(pd);
              if (!_hex_to_rgb(shadow, &r, &g, &b, &a))
                ERR("This error should not happen in style editor... Contact 
devs please!");
              evas_object_color_set(pd->shadow_color, r*a/255, g*a/255, 
b*a/255, a);
 
-             pd->direction[0] = _direction_item_bl_add(item, pd);
-             pd->direction[1] = _direction_item_b_add(item, pd);
-             elm_radio_group_add(pd->direction[1], pd->direction[0]);
-             pd->direction[2] = _direction_item_br_add(item, pd);
-             elm_radio_group_add(pd->direction[2], pd->direction[0]);
-             pd->direction[3] = _direction_item_l_add(item, pd);
-             elm_radio_group_add(pd->direction[3], pd->direction[0]);
-             pd->direction[4] = _direction_item_r_add(item, pd);
-             elm_radio_group_add(pd->direction[4], pd->direction[0]);
-             pd->direction[5] = _direction_item_tl_add(item, pd);
-             elm_radio_group_add(pd->direction[5], pd->direction[0]);
-             pd->direction[6] = _direction_item_t_add(item, pd);
-             elm_radio_group_add(pd->direction[6], pd->direction[0]);
-             pd->direction[7] = _direction_item_tr_add(item, pd);
-             elm_radio_group_add(pd->direction[7], pd->direction[0]);
-
-             elm_object_signal_emit(pd->direction[direction], "mouse,up,1", 
"events");
+             ewe_combobox_select_item_set(pd->direction, direction);
           }
         else
           {

-- 


Reply via email to