summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_widget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elementary/efl_ui_widget.c')
-rw-r--r--src/lib/elementary/efl_ui_widget.c56
1 files changed, 18 insertions, 38 deletions
diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c
index 473be09..6beffdd 100644
--- a/src/lib/elementary/efl_ui_widget.c
+++ b/src/lib/elementary/efl_ui_widget.c
@@ -1192,7 +1192,16 @@ _efl_ui_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd
1192{ 1192{
1193} 1193}
1194 1194
1195EAPI Efl_Ui_Theme_Apply_Error 1195static void
1196_elm_widget_theme_helper(Eina_Error err, Eina_Bool *err_default, Eina_Bool *err_generic)
1197{
1198 if (err == EFL_UI_THEME_APPLY_ERROR_DEFAULT)
1199 *err_default = EINA_TRUE;
1200 else if (err == EFL_UI_THEME_APPLY_ERROR_GENERIC)
1201 *err_generic = EINA_TRUE;
1202}
1203
1204EAPI Eina_Error
1196elm_widget_theme(Evas_Object *obj) 1205elm_widget_theme(Evas_Object *obj)
1197{ 1206{
1198 const Eina_List *l; 1207 const Eina_List *l;
@@ -1206,46 +1215,17 @@ elm_widget_theme(Evas_Object *obj)
1206 1215
1207 EINA_LIST_FOREACH(sd->subobjs, l, child) 1216 EINA_LIST_FOREACH(sd->subobjs, l, child)
1208 if (_elm_widget_is(child)) 1217 if (_elm_widget_is(child))
1209 { 1218 _elm_widget_theme_helper(elm_widget_theme(child), &err_default, &err_generic);
1210 switch (elm_widget_theme(child))
1211 {
1212 case EFL_UI_THEME_APPLY_ERROR_DEFAULT:
1213 err_default = EINA_TRUE;
1214 break;
1215 case EFL_UI_THEME_APPLY_ERROR_GENERIC:
1216 err_generic = EINA_TRUE;
1217 break;
1218 default: break;
1219 }
1220 }
1221 1219
1222 if (sd->hover_obj) 1220 if (sd->hover_obj)
1223 switch (elm_widget_theme(sd->hover_obj)) 1221 _elm_widget_theme_helper(elm_widget_theme(sd->hover_obj), &err_default, &err_generic);
1224 {
1225 case EFL_UI_THEME_APPLY_ERROR_DEFAULT:
1226 err_default = EINA_TRUE;
1227 break;
1228 case EFL_UI_THEME_APPLY_ERROR_GENERIC:
1229 err_generic = EINA_TRUE;
1230 break;
1231 default: break;
1232 }
1233 1222
1234 EINA_LIST_FOREACH(sd->tooltips, l, tt) 1223 EINA_LIST_FOREACH(sd->tooltips, l, tt)
1235 elm_tooltip_theme(tt); 1224 elm_tooltip_theme(tt);
1236 EINA_LIST_FOREACH(sd->cursors, l, cur) 1225 EINA_LIST_FOREACH(sd->cursors, l, cur)
1237 elm_cursor_theme(cur); 1226 elm_cursor_theme(cur);
1238 1227
1239 switch (efl_ui_widget_theme_apply(obj)) 1228 _elm_widget_theme_helper(efl_ui_widget_theme_apply(obj), &err_default, &err_generic);
1240 {
1241 case EFL_UI_THEME_APPLY_ERROR_DEFAULT:
1242 err_default = EINA_TRUE;
1243 break;
1244 case EFL_UI_THEME_APPLY_ERROR_GENERIC:
1245 err_generic = EINA_TRUE;
1246 break;
1247 default: break;
1248 }
1249 if (err_generic) return EFL_UI_THEME_APPLY_ERROR_GENERIC; 1229 if (err_generic) return EFL_UI_THEME_APPLY_ERROR_GENERIC;
1250 if (err_default) return EFL_UI_THEME_APPLY_ERROR_DEFAULT; 1230 if (err_default) return EFL_UI_THEME_APPLY_ERROR_DEFAULT;
1251 return EFL_UI_THEME_APPLY_ERROR_NONE; 1231 return EFL_UI_THEME_APPLY_ERROR_NONE;
@@ -1296,7 +1276,7 @@ elm_widget_theme_specific(Evas_Object *obj,
1296 efl_ui_widget_theme_apply(obj); 1276 efl_ui_widget_theme_apply(obj);
1297} 1277}
1298 1278
1299EOLIAN static Efl_Ui_Theme_Apply_Error 1279EOLIAN static Eina_Error
1300_efl_ui_widget_theme_apply(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED) 1280_efl_ui_widget_theme_apply(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
1301{ 1281{
1302 _elm_widget_mirrored_reload(obj); 1282 _elm_widget_mirrored_reload(obj);
@@ -2827,7 +2807,7 @@ elm_widget_theme_get(const Evas_Object *obj)
2827 return sd->theme; 2807 return sd->theme;
2828} 2808}
2829 2809
2830EOLIAN static Efl_Ui_Theme_Apply_Error 2810EOLIAN static Eina_Error
2831_efl_ui_widget_style_set(Eo *obj, Elm_Widget_Smart_Data *sd, const char *style) 2811_efl_ui_widget_style_set(Eo *obj, Elm_Widget_Smart_Data *sd, const char *style)
2832{ 2812{
2833 if (!elm_widget_is_legacy(obj) && efl_finalized_get(obj)) 2813 if (!elm_widget_is_legacy(obj) && efl_finalized_get(obj))
@@ -2938,7 +2918,7 @@ elm_widget_scroll_child_locked_y_get(const Eo *obj)
2938 return sd->child_drag_y_locked; 2918 return sd->child_drag_y_locked;
2939} 2919}
2940 2920
2941EAPI Efl_Ui_Theme_Apply_Error 2921EAPI Eina_Error
2942elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle) 2922elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle)
2943{ 2923{
2944 Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); 2924 Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
@@ -3554,10 +3534,10 @@ elm_widget_theme_style_get(const Evas_Object *obj)
3554 * @param name An element name of sub object. 3534 * @param name An element name of sub object.
3555 * @return Whether the style was successfully applied or not. 3535 * @return Whether the style was successfully applied or not.
3556 */ 3536 */
3557EAPI Efl_Ui_Theme_Apply_Error 3537EAPI Eina_Error
3558elm_widget_element_update(Evas_Object *obj, Evas_Object *component, const char *name) 3538elm_widget_element_update(Evas_Object *obj, Evas_Object *component, const char *name)
3559{ 3539{
3560 Efl_Ui_Theme_Apply_Error ret = EFL_UI_THEME_APPLY_ERROR_NONE; 3540 Eina_Error ret = EFL_UI_THEME_APPLY_ERROR_NONE;
3561 Eina_Bool changed = EINA_FALSE; 3541 Eina_Bool changed = EINA_FALSE;
3562 const char *obj_group; 3542 const char *obj_group;
3563 Eina_Stringshare *group; 3543 Eina_Stringshare *group;