diff --git a/legacy/elementary/src/lib/elm_main.c b/legacy/elementary/src/lib/elm_main.c index 27268077a4..6764836f9b 100644 --- a/legacy/elementary/src/lib/elm_main.c +++ b/legacy/elementary/src/lib/elm_main.c @@ -1017,12 +1017,12 @@ elm_object_content_part_unset(Evas_Object *obj, const char *part) return elm_widget_content_part_unset(obj, part); } -EAPI void +EAPI Eina_Bool elm_object_style_set(Evas_Object *obj, const char *style) { - EINA_SAFETY_ON_NULL_RETURN(obj); - elm_widget_style_set(obj, style); + EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE); + return elm_widget_style_set(obj, style); } EAPI const char * diff --git a/legacy/elementary/src/lib/elm_object.h b/legacy/elementary/src/lib/elm_object.h index bb540ebaa5..0a2d672686 100644 --- a/legacy/elementary/src/lib/elm_object.h +++ b/legacy/elementary/src/lib/elm_object.h @@ -116,14 +116,15 @@ EAPI Evas_Object *elm_object_name_find(const Evas_Object *obj, c */ /** - * Set the style to use by a widget - * - * Sets the style name that will define the appearance of a widget. Styles - * vary from widget to widget and may also be defined by other themes - * by means of extensions and overlays. + * Set the style to used by a given widget * * @param obj The Elementary widget to style - * @param style The style name to use + * @param style The name of the style to use on it + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise + * + * This sets the style (by name) that will define the appearance of a + * widget. Styles vary from widget to widget and may also be defined + * by other themes by means of extensions and overlays. * * @see elm_theme_extension_add() * @see elm_theme_extension_del() @@ -132,7 +133,7 @@ EAPI Evas_Object *elm_object_name_find(const Evas_Object *obj, c * * @ingroup Styles */ -EAPI void elm_object_style_set(Evas_Object *obj, const char *style); +EAPI Eina_Bool elm_object_style_set(Evas_Object *obj, const char *style); /** * Get the style used by the widget diff --git a/legacy/elementary/src/lib/elm_widget.c b/legacy/elementary/src/lib/elm_widget.c index 6f2b6a9033..c50bc0b1a4 100644 --- a/legacy/elementary/src/lib/elm_widget.c +++ b/legacy/elementary/src/lib/elm_widget.c @@ -655,7 +655,7 @@ elm_widget_signal_callback_del_hook_set(Evas_Object *obj, sd->callback_del_func = func; } -EAPI void +EAPI Eina_Bool elm_widget_theme(Evas_Object *obj) { const Eina_List *l; @@ -663,13 +663,15 @@ elm_widget_theme(Evas_Object *obj) Elm_Tooltip *tt; Elm_Cursor *cur; - API_ENTRY return; + API_ENTRY return EINA_FALSE; EINA_LIST_FOREACH(sd->subobjs, l, child) elm_widget_theme(child); if (sd->resize_obj) elm_widget_theme(sd->resize_obj); if (sd->hover_obj) elm_widget_theme(sd->hover_obj); EINA_LIST_FOREACH(sd->tooltips, l, tt) elm_tooltip_theme(tt); EINA_LIST_FOREACH(sd->cursors, l, cur) elm_cursor_theme(cur); if (sd->theme_func) sd->theme_func(obj); + + return EINA_TRUE; } EAPI void @@ -2491,14 +2493,16 @@ elm_widget_theme_get(const Evas_Object *obj) return sd->theme; } -EAPI void +EAPI Eina_Bool elm_widget_style_set(Evas_Object *obj, const char *style) { - API_ENTRY return; + API_ENTRY return EINA_FALSE; if (eina_stringshare_replace(&sd->style, style)) - elm_widget_theme(obj); + return elm_widget_theme(obj); + + return EINA_TRUE; } EAPI const char * diff --git a/legacy/elementary/src/lib/elm_widget.h b/legacy/elementary/src/lib/elm_widget.h index 5a46a1a019..bcc9498a58 100644 --- a/legacy/elementary/src/lib/elm_widget.h +++ b/legacy/elementary/src/lib/elm_widget.h @@ -306,7 +306,7 @@ EAPI void elm_widget_changed_hook_set(Evas_Object *obj, void (*func) EAPI void elm_widget_signal_emit_hook_set(Evas_Object *obj, void (*func)(Evas_Object *obj, const char *emission, const char *source)); EAPI void elm_widget_signal_callback_add_hook_set(Evas_Object *obj, void (*func)(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)); EAPI void elm_widget_signal_callback_del_hook_set(Evas_Object *obj, void (*func)(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)); -EAPI void elm_widget_theme(Evas_Object *obj); +EAPI Eina_Bool elm_widget_theme(Evas_Object *obj); EAPI void elm_widget_theme_specific(Evas_Object *obj, Elm_Theme *th, Eina_Bool force); EAPI void elm_widget_translate(Evas_Object *obj); EAPI void elm_widget_focus_next_hook_set(Evas_Object *obj, Eina_Bool (*func)(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)); @@ -404,7 +404,7 @@ EAPI Eina_Bool elm_widget_mirrored_automatic_get(const Evas_Object *obj); EAPI void elm_widget_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic); EAPI void elm_widget_theme_set(Evas_Object *obj, Elm_Theme *th); EAPI Elm_Theme *elm_widget_theme_get(const Evas_Object *obj); -EAPI void elm_widget_style_set(Evas_Object *obj, const char *style); +EAPI Eina_Bool elm_widget_style_set(Evas_Object *obj, const char *style); EAPI const char *elm_widget_style_get(const Evas_Object *obj); EAPI void elm_widget_type_set(Evas_Object *obj, const char *type); EAPI const char *elm_widget_type_get(const Evas_Object *obj);