From: Jaeun Choi Date: Fri, 27 Feb 2015 05:15:42 +0000 (+0900) Subject: layout: apply widget's states when elm_layout_file_set is called X-Git-Tag: v1.13.2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a825f09dc8dba20e5a2f221c5d238fcf89202b54;p=platform%2Fupstream%2Felementary.git layout: apply widget's states when elm_layout_file_set is called when a layout's theme is changed by elm_layout_theme_set, the edje is updated according to the widget's states such as 'disabled' or 'highlight_in_theme'. but the update is dropped for elm_layout_file_set. this patch tied up the codes into _visuals_refresh function so that the same update happens for elm_layout_file_set. @fix --- diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c index 4fbb66a..2abb206 100644 --- a/src/lib/elm_layout.c +++ b/src/lib/elm_layout.c @@ -286,18 +286,54 @@ _parts_cursors_apply(Elm_Layout_Smart_Data *sd) } static void +_elm_layout_highlight_in_theme(Evas_Object *obj) +{ + const char *fh; + + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); + + fh = edje_object_data_get + (wd->resize_obj, "focus_highlight"); + if ((fh) && (!strcmp(fh, "on"))) + elm_widget_highlight_in_theme_set(obj, EINA_TRUE); + else + elm_widget_highlight_in_theme_set(obj, EINA_FALSE); + + fh = edje_object_data_get + (wd->resize_obj, "access_highlight"); + if ((fh) && (!strcmp(fh, "on"))) + elm_widget_access_highlight_in_theme_set(obj, EINA_TRUE); + else + elm_widget_access_highlight_in_theme_set(obj, EINA_FALSE); +} + +static Eina_Bool _visuals_refresh(Evas_Object *obj, Elm_Layout_Smart_Data *sd) { + Eina_Bool ret = EINA_FALSE; - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); _parts_swallow_fix(sd, wd); _parts_text_fix(sd); _parts_signals_emit(sd); _parts_cursors_apply(sd); + edje_object_mirrored_set + (wd->resize_obj, elm_widget_mirrored_get(obj)); + + edje_object_scale_set + (wd->resize_obj, + elm_widget_scale_get(obj) * elm_config_scale_get()); + + _elm_layout_highlight_in_theme(obj); + + eo_do(obj, ret = elm_obj_widget_disable()); + eo_do(obj, elm_obj_layout_sizing_eval()); + + return ret; } EOLIAN static Eina_Bool @@ -315,28 +351,6 @@ _elm_layout_elm_widget_disable(Eo *obj, Elm_Layout_Smart_Data *_pd EINA_UNUSED) return EINA_TRUE; } -static void -_elm_layout_highlight_in_theme(Evas_Object *obj) -{ - const char *fh; - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - fh = edje_object_data_get - (wd->resize_obj, "focus_highlight"); - if ((fh) && (!strcmp(fh, "on"))) - elm_widget_highlight_in_theme_set(obj, EINA_TRUE); - else - elm_widget_highlight_in_theme_set(obj, EINA_FALSE); - - fh = edje_object_data_get - (wd->resize_obj, "access_highlight"); - if ((fh) && (!strcmp(fh, "on"))) - elm_widget_access_highlight_in_theme_set(obj, EINA_TRUE); - else - elm_widget_access_highlight_in_theme_set(obj, EINA_FALSE); -} - static Eina_Bool _elm_layout_theme_internal(Eo *obj, Elm_Layout_Smart_Data *sd) { @@ -349,21 +363,10 @@ _elm_layout_theme_internal(Eo *obj, Elm_Layout_Smart_Data *sd) elm_widget_style_get(obj))) return EINA_FALSE; - edje_object_mirrored_set - (wd->resize_obj, elm_widget_mirrored_get(obj)); - - edje_object_scale_set - (wd->resize_obj, - elm_widget_scale_get(obj) * elm_config_scale_get()); - - _elm_layout_highlight_in_theme(obj); + ret = _visuals_refresh(obj, sd); evas_object_smart_callback_call(obj, SIG_THEME_CHANGED, NULL); - _visuals_refresh(obj, sd); - - eo_do(obj, ret = elm_obj_widget_disable()); - return ret; }