summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSungtaek Hong <sth253.hong@samsung.com>2017-11-14 19:59:42 +0900
committerSungtaek Hong <sth253.hong@samsung.com>2017-12-08 15:57:26 +0900
commitdd4467505ea29d6120e5e7d467d76836a6630ff4 (patch)
treeaeb0cc91f72e33d732a655ee1f6b80383b99cf9f /src
parentcff9b1b11ae2fa25f24821bcefc3a2a02f693a4b (diff)
efl_ui_widget: find new edc resource for efl_ui_widgets
new eo widgets(efl_ui_ prefix) finds new edc group in data/elementary/themes/edc/efl/*.edc. New group name is "klass/group:style" and "base" group name and "default" style name can be omitted. for now, separator for style is ':' but needs to be decided.
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_panes.c68
-rw-r--r--src/lib/elementary/efl_ui_slider.c12
-rw-r--r--src/lib/elementary/efl_ui_text.c79
-rw-r--r--src/lib/elementary/efl_ui_win.c20
-rw-r--r--src/lib/elementary/elm_priv.h3
-rw-r--r--src/lib/elementary/elm_spinner.c7
-rw-r--r--src/lib/elementary/elm_theme.c26
-rw-r--r--src/lib/elementary/elm_widget.c10
-rw-r--r--src/lib/elementary/els_cursor.c6
-rw-r--r--src/lib/elementary/elu_ews_wm.c8
10 files changed, 157 insertions, 82 deletions
diff --git a/src/lib/elementary/efl_ui_panes.c b/src/lib/elementary/efl_ui_panes.c
index 1d70fd23d5..893ee1d72a 100644
--- a/src/lib/elementary/efl_ui_panes.c
+++ b/src/lib/elementary/efl_ui_panes.c
@@ -53,18 +53,78 @@ static const Elm_Layout_Part_Alias_Description _content_aliases[] =
53 53
54static void _set_min_size_new(void *data); 54static void _set_min_size_new(void *data);
55 55
56//TODO: efl_ui_slider also use this.
57static const char *
58_theme_group_modify_pos_get(const char *cur_group, const char *search, size_t len, Eina_Bool is_legacy)
59{
60 const char *pos = NULL;
61 const char *temp_str = NULL;
62
63 if (is_legacy)
64 return cur_group;
65
66 temp_str = cur_group + len - strlen(search);
67 if (temp_str >= cur_group)
68 {
69 if (!strcmp(temp_str, search))
70 pos = temp_str;
71 }
72
73 return pos;
74}
75
76static char *
77_efl_ui_panes_theme_group_get(Evas_Object *obj, Efl_Ui_Panes_Data *sd)
78{
79 const char *pos = NULL;
80 const char *cur_group = elm_widget_theme_element_get(obj);
81 Eina_Strbuf *new_group = eina_strbuf_new();
82 Eina_Bool is_legacy = elm_widget_is_legacy(obj);
83 size_t len = 0;
84
85 if (cur_group)
86 {
87 len = strlen(cur_group);
88 pos = _theme_group_modify_pos_get(cur_group, "horizontal", len, is_legacy);
89 if (!pos)
90 pos = _theme_group_modify_pos_get(cur_group, "vertical", len, is_legacy);
91
92 // TODO: change separator when it is decided.
93 // can skip when prev_group == cur_group
94 if (!pos)
95 {
96 eina_strbuf_append(new_group, cur_group);
97 eina_strbuf_append(new_group, "/");
98 }
99 else
100 {
101 eina_strbuf_append_length(new_group, cur_group, pos - cur_group);
102 }
103 }
104
105 if (sd->dir == EFL_UI_DIR_HORIZONTAL)
106 eina_strbuf_append(new_group, "horizontal");
107 else
108 eina_strbuf_append(new_group, "vertical");
109
110 return eina_strbuf_release(new_group);
111}
112
56EOLIAN static Efl_Ui_Theme_Apply 113EOLIAN static Efl_Ui_Theme_Apply
57_efl_ui_panes_elm_widget_theme_apply(Eo *obj, Efl_Ui_Panes_Data *sd) 114_efl_ui_panes_elm_widget_theme_apply(Eo *obj, Efl_Ui_Panes_Data *sd)
58{ 115{
59 double size; 116 double size;
60 Evas_Coord minw = 0, minh = 0; 117 Evas_Coord minw = 0, minh = 0;
118 char *group;
61 119
62 Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED; 120 Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
63 121
64 if (sd->dir == EFL_UI_DIR_HORIZONTAL) 122 group = _efl_ui_panes_theme_group_get(obj, sd);
65 elm_widget_theme_element_set(obj, "horizontal"); 123 if (group)
66 else 124 {
67 elm_widget_theme_element_set(obj, "vertical"); 125 elm_widget_theme_element_set(obj, group);
126 free(group);
127 }
68 128
69 evas_object_hide(sd->event); 129 evas_object_hide(sd->event);
70 elm_coords_finger_size_adjust(1, &minw, 1, &minh); 130 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c
index e445385d65..9ec6cb2e2b 100644
--- a/src/lib/elementary/efl_ui_slider.c
+++ b/src/lib/elementary/efl_ui_slider.c
@@ -663,9 +663,9 @@ _popup_add(Efl_Ui_Slider_Data *sd, Eo *obj, Evas_Object **popup,
663 *popup = edje_object_add(evas_object_evas_get(obj)); 663 *popup = edje_object_add(evas_object_evas_get(obj));
664 evas_object_smart_member_add(*popup, obj); 664 evas_object_smart_member_add(*popup, obj);
665 if (_is_horizontal(sd->dir)) 665 if (_is_horizontal(sd->dir))
666 _elm_theme_set(elm_widget_theme_get(obj), *popup, "slider", "horizontal/popup", elm_widget_style_get(obj)); 666 efl_ui_widget_theme_object_set(obj, *popup, "slider", "horizontal/popup", elm_widget_style_get(obj));
667 else 667 else
668 _elm_theme_set(elm_widget_theme_get(obj), *popup, "slider", "vertical/popup", elm_widget_style_get(obj)); 668 efl_ui_widget_theme_object_set(obj, *popup, "slider", "vertical/popup", elm_widget_style_get(obj));
669 edje_object_scale_set(*popup, efl_gfx_scale_get(obj) * 669 edje_object_scale_set(*popup, efl_gfx_scale_get(obj) *
670 elm_config_scale_get()); 670 elm_config_scale_get());
671 edje_object_signal_callback_add(*popup, "popup,hide,done", "elm", // XXX: for compat 671 edje_object_signal_callback_add(*popup, "popup,hide,done", "elm", // XXX: for compat
@@ -708,11 +708,11 @@ _efl_ui_slider_elm_widget_theme_apply(Eo *obj, Efl_Ui_Slider_Data *sd)
708 else 708 else
709 elm_widget_theme_element_set(obj, "range/horizontal"); 709 elm_widget_theme_element_set(obj, "range/horizontal");
710 if (sd->popup) 710 if (sd->popup)
711 _elm_theme_set(elm_widget_theme_get(obj), sd->popup, 711 efl_ui_widget_theme_object_set(obj, sd->popup,
712 "slider", "horizontal/popup", 712 "slider", "horizontal/popup",
713 elm_widget_style_get(obj)); 713 elm_widget_style_get(obj));
714 if (sd->popup2) 714 if (sd->popup2)
715 _elm_theme_set(elm_widget_theme_get(obj), sd->popup2, 715 efl_ui_widget_theme_object_set(obj, sd->popup2,
716 "slider", "horizontal/popup", 716 "slider", "horizontal/popup",
717 elm_widget_style_get(obj)); 717 elm_widget_style_get(obj));
718 } 718 }
@@ -724,11 +724,11 @@ _efl_ui_slider_elm_widget_theme_apply(Eo *obj, Efl_Ui_Slider_Data *sd)
724 elm_widget_theme_element_set(obj, "range/vertical"); 724 elm_widget_theme_element_set(obj, "range/vertical");
725 725
726 if (sd->popup) 726 if (sd->popup)
727 _elm_theme_set(elm_widget_theme_get(obj), sd->popup, 727 efl_ui_widget_theme_object_set(obj, sd->popup,
728 "slider", "vertical/popup", 728 "slider", "vertical/popup",
729 elm_widget_style_get(obj)); 729 elm_widget_style_get(obj));
730 if (sd->popup2) 730 if (sd->popup2)
731 _elm_theme_set(elm_widget_theme_get(obj), sd->popup2, 731 efl_ui_widget_theme_object_set(obj, sd->popup2,
732 "slider", "vertical/popup", 732 "slider", "vertical/popup",
733 elm_widget_style_get(obj)); 733 elm_widget_style_get(obj));
734 } 734 }
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index 758681272a..44f546d31e 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -658,56 +658,43 @@ _efl_ui_text_theme_group_get(Evas_Object *obj)
658{ 658{
659 EFL_UI_TEXT_DATA_GET(obj, sd); 659 EFL_UI_TEXT_DATA_GET(obj, sd);
660 660
661 if (sd->password) return "password";
661 if (sd->editable) 662 if (sd->editable)
662 { 663 {
663 if (sd->password) return "base-password"; 664 if (sd->single_line) return "single";
664 else 665 switch (sd->line_wrap)
665 { 666 {
666 if (sd->single_line) return "base-single"; 667 case ELM_WRAP_CHAR:
667 else 668 return "charwrap";
668 {
669 switch (sd->line_wrap)
670 {
671 case ELM_WRAP_CHAR:
672 return "base-charwrap";
673 669
674 case ELM_WRAP_WORD: 670 case ELM_WRAP_WORD:
675 return "base"; 671 return "base";
676 672
677 case ELM_WRAP_MIXED: 673 case ELM_WRAP_MIXED:
678 return "base-mixedwrap"; 674 return "mixedwrap";
679 675
680 case ELM_WRAP_NONE: 676 case ELM_WRAP_NONE:
681 default: 677 default:
682 return "base-nowrap"; 678 return "nowrap";
683 }
684 }
685 } 679 }
686 } 680 }
687 else 681 else
688 { 682 {
689 if (sd->password) return "base-password"; 683 if (sd->single_line) return "single-noedit";
690 else 684 switch (sd->line_wrap)
691 { 685 {
692 if (sd->single_line) return "base-single-noedit"; 686 case ELM_WRAP_CHAR:
693 else 687 return "noedit-charwrap";
694 {
695 switch (sd->line_wrap)
696 {
697 case ELM_WRAP_CHAR:
698 return "base-noedit-charwrap";
699 688
700 case ELM_WRAP_WORD: 689 case ELM_WRAP_WORD:
701 return "base-noedit"; 690 return "noedit";
702 691
703 case ELM_WRAP_MIXED: 692 case ELM_WRAP_MIXED:
704 return "base-noedit-mixedwrap"; 693 return "noedit-mixedwrap";
705 694
706 case ELM_WRAP_NONE: 695 case ELM_WRAP_NONE:
707 default: 696 default:
708 return "base-nowrap-noedit"; 697 return "nowrap-noedit";
709 }
710 }
711 } 698 }
712 } 699 }
713} 700}
@@ -931,7 +918,7 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
931 _mirrored_set(obj, efl_ui_mirrored_get(obj)); 918 _mirrored_set(obj, efl_ui_mirrored_get(obj));
932 919
933 elm_widget_theme_object_set 920 elm_widget_theme_object_set
934 (obj, sd->entry_edje, "efl_ui_text", _efl_ui_text_theme_group_get(obj), style); 921 (obj, sd->entry_edje, "text", _efl_ui_text_theme_group_get(obj), style);
935 922
936 if (elm_widget_disabled_get(obj)) 923 if (elm_widget_disabled_get(obj))
937 edje_object_signal_emit(sd->entry_edje, "elm,state,disabled", "elm"); 924 edje_object_signal_emit(sd->entry_edje, "elm,state,disabled", "elm");
@@ -1007,9 +994,9 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
1007 if (sd->start_handler) 994 if (sd->start_handler)
1008 { 995 {
1009 elm_widget_theme_object_set(obj, sd->start_handler, 996 elm_widget_theme_object_set(obj, sd->start_handler,
1010 "entry", "handler/start", style); 997 "text", "handler/start", style);
1011 elm_widget_theme_object_set(obj, sd->end_handler, 998 elm_widget_theme_object_set(obj, sd->end_handler,
1012 "entry", "handler/end", style); 999 "text", "handler/end", style);
1013 } 1000 }
1014 1001
1015 sd->changed = EINA_TRUE; 1002 sd->changed = EINA_TRUE;
@@ -1753,7 +1740,7 @@ _magnifier_create(void *data)
1753 1740
1754 //Bg 1741 //Bg
1755 sd->mgf_bg = edje_object_add(e); 1742 sd->mgf_bg = edje_object_add(e);
1756 _elm_theme_object_set(data, sd->mgf_bg, "entry", "magnifier", "default"); 1743 elm_widget_theme_object_set(data, sd->mgf_bg, "text", "magnifier", "default");
1757 evas_object_show(sd->mgf_bg); 1744 evas_object_show(sd->mgf_bg);
1758 1745
1759 //Proxy 1746 //Proxy
@@ -2582,16 +2569,16 @@ _item_get(void *data, const char *item)
2582 evas_object_del(o); 2569 evas_object_del(o);
2583 o = edje_object_add(evas_object_evas_get(data)); 2570 o = edje_object_add(evas_object_evas_get(data));
2584 elm_widget_theme_object_set 2571 elm_widget_theme_object_set
2585 (data, o, "entry/emoticon", "wtf", style); 2572 (data, o, "text/emoticon", "wtf", style);
2586 } 2573 }
2587 return o; 2574 return o;
2588 } 2575 }
2589 2576
2590 o = edje_object_add(evas_object_evas_get(data)); 2577 o = edje_object_add(evas_object_evas_get(data));
2591 if (!elm_widget_theme_object_set 2578 if (!elm_widget_theme_object_set
2592 (data, o, "entry", item, style)) 2579 (data, o, "text", item, style))
2593 elm_widget_theme_object_set 2580 elm_widget_theme_object_set
2594 (data, o, "entry/emoticon", "wtf", style); 2581 (data, o, "text/emoticon", "wtf", style);
2595 return o; 2582 return o;
2596} 2583}
2597 2584
@@ -3027,7 +3014,7 @@ _efl_ui_text_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Text_Data *priv)
3027 _dnd_pos_cb, NULL, 3014 _dnd_pos_cb, NULL,
3028 _dnd_drop_cb, NULL); 3015 _dnd_drop_cb, NULL);
3029 3016
3030 if (!elm_layout_theme_set(obj, "efl_ui_text", "base", elm_widget_style_get(obj))) 3017 if (!elm_layout_theme_set(obj, "text", "base", elm_widget_style_get(obj)))
3031 CRI("Failed to set layout!"); 3018 CRI("Failed to set layout!");
3032 3019
3033 edje_object_part_swallow(priv->entry_edje, "elm.text", text_obj); 3020 edje_object_part_swallow(priv->entry_edje, "elm.text", text_obj);
@@ -3189,7 +3176,7 @@ _create_selection_handlers(Evas_Object *obj, Efl_Ui_Text_Data *sd,
3189{ 3176{
3190 Evas_Object *handle; 3177 Evas_Object *handle;
3191 3178
3192 handle = _decoration_create(sd, file, "elm/entry/handler/start", EINA_TRUE); 3179 handle = _decoration_create(sd, file, "text/handler/start", EINA_TRUE);
3193 evas_object_pass_events_set(handle, EINA_FALSE); 3180 evas_object_pass_events_set(handle, EINA_FALSE);
3194 sd->start_handler = handle; 3181 sd->start_handler = handle;
3195 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_DOWN, 3182 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_DOWN,
@@ -3200,7 +3187,7 @@ _create_selection_handlers(Evas_Object *obj, Efl_Ui_Text_Data *sd,
3200 _start_handler_mouse_up_cb, obj); 3187 _start_handler_mouse_up_cb, obj);
3201 evas_object_show(handle); 3188 evas_object_show(handle);
3202 3189
3203 handle = _decoration_create(sd, file, "elm/entry/handler/end", EINA_TRUE); 3190 handle = _decoration_create(sd, file, "text/handler/end", EINA_TRUE);
3204 evas_object_pass_events_set(handle, EINA_FALSE); 3191 evas_object_pass_events_set(handle, EINA_FALSE);
3205 sd->end_handler = handle; 3192 sd->end_handler = handle;
3206 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_DOWN, 3193 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_DOWN,
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 5472d8197f..457d65db01 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -1170,7 +1170,7 @@ _elm_win_focus_highlight_reconfigure_job(void *data)
1170 else 1170 else
1171 str = "default"; 1171 str = "default";
1172 1172
1173 elm_widget_theme_object_set 1173 efl_ui_widget_theme_object_set
1174 (sd->obj, fobj, "focus_highlight", "top", str); 1174 (sd->obj, fobj, "focus_highlight", "top", str);
1175 sd->focus_highlight.theme_changed = EINA_FALSE; 1175 sd->focus_highlight.theme_changed = EINA_FALSE;
1176 1176
@@ -3153,15 +3153,15 @@ _elm_win_wl_cursor_set(Evas_Object *obj, const char *cursor)
3153 3153
3154 if (cursor) 3154 if (cursor)
3155 { 3155 {
3156 if (!_elm_theme_object_set(sd->obj, sd->pointer.obj, 3156 if (!efl_ui_widget_theme_object_set(sd->obj, sd->pointer.obj,
3157 "cursor", cursor, "default")) 3157 "cursor", cursor, "default"))
3158 { 3158 {
3159 _elm_theme_object_set(sd->obj, sd->pointer.obj, 3159 efl_ui_widget_theme_object_set(sd->obj, sd->pointer.obj,
3160 "pointer", "base", "default"); 3160 "pointer", "base", "default");
3161 } 3161 }
3162 } 3162 }
3163 else 3163 else
3164 _elm_theme_object_set(sd->obj, sd->pointer.obj, 3164 efl_ui_widget_theme_object_set(sd->obj, sd->pointer.obj,
3165 "pointer", "base", "default"); 3165 "pointer", "base", "default");
3166 3166
3167 edje_object_size_min_get(sd->pointer.obj, &mw, &mh); 3167 edje_object_size_min_get(sd->pointer.obj, &mw, &mh);
@@ -3976,7 +3976,7 @@ _elm_win_frame_cb_resize_show(void *data,
3976 { 3976 {
3977 Efl_Ui_Win_Move_Resize_Mode mode = _move_resize_mode_get(source); 3977 Efl_Ui_Win_Move_Resize_Mode mode = _move_resize_mode_get(source);
3978 const resize_info *ri = _resize_info_get(sd->rot, mode); 3978 const resize_info *ri = _resize_info_get(sd->rot, mode);
3979 if (ri) _elm_theme_object_set(sd->obj, sd->pointer.obj, "pointer", "base", ri->cursor); 3979 if (ri) efl_ui_widget_theme_object_set(sd->obj, sd->pointer.obj, "pointer", "base", ri->cursor);
3980 } 3980 }
3981#else 3981#else
3982 (void)source; 3982 (void)source;
@@ -3996,7 +3996,7 @@ _elm_win_frame_cb_resize_hide(void *data,
3996 3996
3997#ifdef HAVE_ELEMENTARY_WL2 3997#ifdef HAVE_ELEMENTARY_WL2
3998 if (sd->pointer.obj) 3998 if (sd->pointer.obj)
3999 _elm_theme_object_set(sd->obj, sd->pointer.obj, 3999 efl_ui_widget_theme_object_set(sd->obj, sd->pointer.obj,
4000 "pointer", "base", "default"); 4000 "pointer", "base", "default");
4001#endif 4001#endif
4002} 4002}
@@ -4288,7 +4288,7 @@ _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style)
4288 v = version ? atoi(version) : 0; 4288 v = version ? atoi(version) : 0;
4289 if (EINA_LIKELY(v >= FRAME_OBJ_THEME_MIN_VERSION)) 4289 if (EINA_LIKELY(v >= FRAME_OBJ_THEME_MIN_VERSION))
4290 { 4290 {
4291 if (!elm_widget_theme_object_set 4291 if (!efl_ui_widget_theme_object_set
4292 (sd->obj, sd->frame_obj, "border", element, style)) 4292 (sd->obj, sd->frame_obj, "border", element, style))
4293 { 4293 {
4294 ERR("Failed to set main border theme for the window."); 4294 ERR("Failed to set main border theme for the window.");
@@ -5240,7 +5240,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
5240 Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0; 5240 Evas_Coord mw = 1, mh = 1, hx = 0, hy = 0;
5241 5241
5242 sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee)); 5242 sd->pointer.obj = o = edje_object_add(ecore_evas_get(tmp_sd.ee));
5243 _elm_theme_object_set(obj, o, "pointer", "base", "default"); 5243 efl_ui_widget_theme_object_set(obj, o, "pointer", "base", "default");
5244 edje_object_size_min_calc(o, &mw, &mh); 5244 edje_object_size_min_calc(o, &mw, &mh);
5245 evas_object_resize(o, mw, mh); 5245 evas_object_resize(o, mw, mh);
5246 edje_object_part_geometry_get(o, "elm.swallow.hotspot", 5246 edje_object_part_geometry_get(o, "elm.swallow.hotspot",
@@ -6517,8 +6517,8 @@ _elm_win_theme_internal(Eo *obj, Efl_Ui_Win_Data *sd)
6517 Eina_Bool ret = EINA_FALSE, prev_alpha; 6517 Eina_Bool ret = EINA_FALSE, prev_alpha;
6518 const char *s; 6518 const char *s;
6519 6519
6520 int_ret = _elm_theme_object_set(obj, sd->legacy.edje, "win", "base", 6520 int_ret = efl_ui_widget_theme_object_set(obj, sd->legacy.edje, "win", "base",
6521 elm_widget_style_get(obj)); 6521 elm_widget_style_get(obj));
6522 if (!int_ret) return EFL_UI_THEME_APPLY_FAILED; 6522 if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
6523 6523
6524 edje_object_mirrored_set(sd->legacy.edje, efl_ui_mirrored_get(obj)); 6524 edje_object_mirrored_set(sd->legacy.edje, efl_ui_mirrored_get(obj));
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 802938458b..135b06b758 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -540,7 +540,8 @@ Efl_Ui_Theme_Apply _elm_theme_set(Elm_Theme *th,
540 Evas_Object *o, 540 Evas_Object *o,
541 const char *clas, 541 const char *clas,
542 const char *group, 542 const char *group,
543 const char *style); 543 const char *style,
544 Eina_Bool is_legacy);
544Eina_Bool _elm_theme_icon_set(Elm_Theme *th, 545Eina_Bool _elm_theme_icon_set(Elm_Theme *th,
545 Evas_Object *o, 546 Evas_Object *o,
546 const char *group, 547 const char *group,
diff --git a/src/lib/elementary/elm_spinner.c b/src/lib/elementary/elm_spinner.c
index 5c25079064..3e809ef02b 100644
--- a/src/lib/elementary/elm_spinner.c
+++ b/src/lib/elementary/elm_spinner.c
@@ -1293,8 +1293,11 @@ _elm_spinner_elm_widget_theme_apply(Eo *obj, Elm_Spinner_Data *sd)
1293{ 1293{
1294 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED); 1294 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
1295 1295
1296 if (!elm_layout_theme_set(obj, "spinner", "base", elm_widget_style_get(obj))) 1296 if (!efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)))
1297 CRI("Failed to set layout!"); 1297 {
1298 CRI("Failed to set layout!");
1299 return EFL_UI_THEME_APPLY_FAILED;
1300 }
1298 1301
1299 if (edje_object_part_exists(wd->resize_obj, "elm.swallow.dec_button")) 1302 if (edje_object_part_exists(wd->resize_obj, "elm.swallow.dec_button"))
1300 sd->button_layout = EINA_TRUE; 1303 sd->button_layout = EINA_TRUE;
diff --git a/src/lib/elementary/elm_theme.c b/src/lib/elementary/elm_theme.c
index 3f2144b93d..69028c6770 100644
--- a/src/lib/elementary/elm_theme.c
+++ b/src/lib/elementary/elm_theme.c
@@ -281,7 +281,7 @@ _elm_theme_object_set(Evas_Object *parent, Evas_Object *o, const char *clas, con
281 Elm_Theme *th = NULL; 281 Elm_Theme *th = NULL;
282 282
283 if (parent) th = elm_widget_theme_get(parent); 283 if (parent) th = elm_widget_theme_get(parent);
284 return _elm_theme_set(th, o, clas, group, style); 284 return _elm_theme_set(th, o, clas, group, style, elm_widget_is_legacy(parent));
285} 285}
286 286
287/* only issued by elm_icon.c */ 287/* only issued by elm_icon.c */
@@ -296,14 +296,21 @@ _elm_theme_object_icon_set(Evas_Object *o,
296} 296}
297 297
298Efl_Ui_Theme_Apply 298Efl_Ui_Theme_Apply
299_elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *group, const char *style) 299_elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *group, const char *style, Eina_Bool is_legacy)
300{ 300{
301 Eina_File *file; 301 Eina_File *file;
302 char buf2[1024]; 302 char buf2[1024];
303 const char *group_sep = "/";
304 const char *style_sep = ":";
303 305
304 if ((!clas) || (!group) || (!style) || !o) return EFL_UI_THEME_APPLY_FAILED; 306 if ((!clas) || !o) return EFL_UI_THEME_APPLY_FAILED;
305 if (!th) th = &(theme_default); 307 if (!th) th = &(theme_default);
306 snprintf(buf2, sizeof(buf2), "elm/%s/%s/%s", clas, group, style); 308 if (is_legacy)
309 snprintf(buf2, sizeof(buf2), "elm/%s/%s/%s", clas, (group) ? group : "base", (style) ? style : "default");
310 else
311 snprintf(buf2, sizeof(buf2), "efl/%s%s%s%s%s", clas,
312 ((group) ? group_sep : "\0"), ((group) ? group : "\0"),
313 ((style) ? style_sep : "\0"), ((style) ? style : "\0"));
307 if (!eina_hash_find(th->cache_style_load_failed, buf2)) 314 if (!eina_hash_find(th->cache_style_load_failed, buf2))
308 { 315 {
309 file = _elm_theme_group_file_find(th, buf2); 316 file = _elm_theme_group_file_find(th, buf2);
@@ -312,7 +319,7 @@ _elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *grou
312 if (edje_object_mmap_set(o, file, buf2)) return EFL_UI_THEME_APPLY_SUCCESS; 319 if (edje_object_mmap_set(o, file, buf2)) return EFL_UI_THEME_APPLY_SUCCESS;
313 else 320 else
314 { 321 {
315 INF("could not set theme group '%s' from file '%s': %s", 322 ERR("could not set theme group '%s' from file '%s': %s",
316 buf2, 323 buf2,
317 eina_file_filename_get(file), 324 eina_file_filename_get(file),
318 edje_load_error_str(edje_object_load_error_get(o))); 325 edje_load_error_str(edje_object_load_error_get(o)));
@@ -322,8 +329,15 @@ _elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *grou
322 eina_hash_add(th->cache_style_load_failed, buf2, (void *)1); 329 eina_hash_add(th->cache_style_load_failed, buf2, (void *)1);
323 } 330 }
324 331
332 if (!style)
333 return EFL_UI_THEME_APPLY_FAILED;
334
325 // Use the elementary default style. 335 // Use the elementary default style.
326 snprintf(buf2, sizeof(buf2), "elm/%s/%s/default", clas, group); 336 if (is_legacy)
337 snprintf(buf2, sizeof(buf2), "elm/%s/%s/%s", clas, (group) ? group : "base", "default");
338 else
339 snprintf(buf2, sizeof(buf2), "efl/%s%s%s", clas,
340 ((group) ? group_sep : "\0"), ((group) ? group : "\0"));
327 if (!eina_hash_find(th->cache_style_load_failed, buf2)) 341 if (!eina_hash_find(th->cache_style_load_failed, buf2))
328 { 342 {
329 file = _elm_theme_group_file_find(th, buf2); 343 file = _elm_theme_group_file_find(th, buf2);
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index 89386b22c6..45163c806e 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -3016,6 +3016,10 @@ elm_widget_scroll_child_locked_y_get(const Eo *obj)
3016EOLIAN static Efl_Ui_Theme_Apply 3016EOLIAN static Efl_Ui_Theme_Apply
3017_elm_widget_theme_object_set(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle) 3017_elm_widget_theme_object_set(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle)
3018{ 3018{
3019 if (eina_streq(welement, "base"))
3020 welement = NULL;
3021 if (eina_streq(wstyle, "default"))
3022 wstyle = NULL;
3019 Efl_Ui_Theme_Apply ret = _elm_theme_object_set(obj, edj, wname, welement, wstyle); 3023 Efl_Ui_Theme_Apply ret = _elm_theme_object_set(obj, edj, wname, welement, wstyle);
3020 if (!ret) 3024 if (!ret)
3021 { 3025 {
@@ -3613,6 +3617,9 @@ EAPI Eina_Bool
3613elm_widget_theme_element_set(Evas_Object *obj, const char *name) 3617elm_widget_theme_element_set(Evas_Object *obj, const char *name)
3614{ 3618{
3615 ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, EINA_FALSE); 3619 ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, EINA_FALSE);
3620 if (eina_streq(name, "base"))
3621 name = NULL;
3622
3616 return eina_stringshare_replace(&(pd->group), name); 3623 return eina_stringshare_replace(&(pd->group), name);
3617} 3624}
3618 3625
@@ -3643,6 +3650,9 @@ EAPI Eina_Bool
3643elm_widget_theme_style_set(Evas_Object *obj, const char *name) 3650elm_widget_theme_style_set(Evas_Object *obj, const char *name)
3644{ 3651{
3645 ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, EINA_FALSE); 3652 ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, EINA_FALSE);
3653 if (eina_streq(name, "default"))
3654 name = NULL;
3655
3646 return eina_stringshare_replace(&(pd->style), name); 3656 return eina_stringshare_replace(&(pd->style), name);
3647} 3657}
3648 3658
diff --git a/src/lib/elementary/els_cursor.c b/src/lib/elementary/els_cursor.c
index f8be56ec89..9f1a371799 100644
--- a/src/lib/elementary/els_cursor.c
+++ b/src/lib/elementary/els_cursor.c
@@ -270,7 +270,7 @@ _elm_cursor_obj_add(Evas_Object *obj, Elm_Cursor *cur)
270 cur->obj = edje_object_add(cur->evas); 270 cur->obj = edje_object_add(cur->evas);
271 if (!cur->obj) return EINA_FALSE; 271 if (!cur->obj) return EINA_FALSE;
272 272
273 if (!_elm_theme_object_set(obj, cur->obj, "cursor", cur->cursor_name, 273 if (!efl_ui_widget_theme_object_set(obj, cur->obj, "cursor", cur->cursor_name,
274 cur->style ? cur->style : "default")) 274 cur->style ? cur->style : "default"))
275 { 275 {
276 ELM_SAFE_FREE(cur->obj, evas_object_del); 276 ELM_SAFE_FREE(cur->obj, evas_object_del);
@@ -740,7 +740,7 @@ _elm_widget_efl_ui_cursor_cursor_style_set(Evas_Object *obj, Elm_Widget_Smart_Da
740 } 740 }
741 else 741 else
742 { 742 {
743 if (!_elm_theme_object_set(obj, cur->obj, "cursor", cur->cursor_name, 743 if (!efl_ui_widget_theme_object_set(obj, cur->obj, "cursor", cur->cursor_name,
744 style)) 744 style))
745 { 745 {
746 ERR("Could not apply the theme to the cursor style=%s", style); 746 ERR("Could not apply the theme to the cursor style=%s", style);
@@ -768,7 +768,7 @@ void
768elm_cursor_theme(Elm_Cursor *cur) 768elm_cursor_theme(Elm_Cursor *cur)
769{ 769{
770 if ((!cur) || (!cur->obj)) return; 770 if ((!cur) || (!cur->obj)) return;
771 if (!_elm_theme_object_set(cur->owner, cur->obj, "cursor", 771 if (!efl_ui_widget_theme_object_set(cur->owner, cur->obj, "cursor",
772 cur->cursor_name, cur->style)) 772 cur->cursor_name, cur->style))
773 ERR("Could not apply the theme to the cursor style=%s", cur->style); 773 ERR("Could not apply the theme to the cursor style=%s", cur->style);
774 else 774 else
diff --git a/src/lib/elementary/elu_ews_wm.c b/src/lib/elementary/elu_ews_wm.c
index d8c63cfc70..9799b2acf7 100644
--- a/src/lib/elementary/elu_ews_wm.c
+++ b/src/lib/elementary/elu_ews_wm.c
@@ -170,7 +170,7 @@ _elm_ews_border_config_apply(Ecore_Evas *ee, Evas_Object *o, Elm_Theme *th)
170 if (ecore_evas_borderless_get(ee)) 170 if (ecore_evas_borderless_get(ee))
171 style = "borderless"; 171 style = "borderless";
172 172
173 _elm_theme_set(th, o, "ews", "decoration", style ? style : "default"); 173 _elm_theme_set(th, o, "ews", "decoration", style ? style : "default", EINA_TRUE);
174 174
175 if (ecore_evas_shaped_get(ee) || ecore_evas_alpha_get(ee) || 175 if (ecore_evas_shaped_get(ee) || ecore_evas_alpha_get(ee) ||
176 ecore_evas_transparent_get(ee)) 176 ecore_evas_transparent_get(ee))
@@ -446,7 +446,7 @@ _elm_ews_wm_rescale(Elm_Theme *th, Eina_Bool use_theme)
446 _elm_ews_wm_border_theme_set(*(void**)tp->key, tp->data, NULL); 446 _elm_ews_wm_border_theme_set(*(void**)tp->key, tp->data, NULL);
447 447
448 if (_ews_bg) 448 if (_ews_bg)
449 _elm_theme_set(NULL, _ews_bg, "ews", "background", "default"); 449 _elm_theme_set(NULL, _ews_bg, "ews", "background", "default", EINA_TRUE);
450 } 450 }
451 else 451 else
452 { 452 {
@@ -454,7 +454,7 @@ _elm_ews_wm_rescale(Elm_Theme *th, Eina_Bool use_theme)
454 _elm_ews_wm_border_theme_set(*(void**)tp->key, tp->data, th); 454 _elm_ews_wm_border_theme_set(*(void**)tp->key, tp->data, th);
455 455
456 if (_ews_bg) 456 if (_ews_bg)
457 _elm_theme_set(th, _ews_bg, "ews", "background", "default"); 457 _elm_theme_set(th, _ews_bg, "ews", "background", "default", EINA_TRUE);
458 } 458 }
459 459
460 eina_iterator_free(it); 460 eina_iterator_free(it);
@@ -477,7 +477,7 @@ _elm_ews_wm_init(void)
477 o = edje_object_add(e); 477 o = edje_object_add(e);
478 if (!o) return EINA_FALSE; 478 if (!o) return EINA_FALSE;
479 479
480 if (!_elm_theme_set(NULL, o, "ews", "background", "default")) 480 if (!_elm_theme_set(NULL, o, "ews", "background", "default", EINA_TRUE))
481 { 481 {
482 ERR("Could not set background theme, fallback to rectangle"); 482 ERR("Could not set background theme, fallback to rectangle");
483 evas_object_del(o); 483 evas_object_del(o);