summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaeun Choi <jaeun12.choi@samsung.com>2015-02-27 14:15:42 +0900
committerJaeun Choi <jaeun12.choi@samsung.com>2015-03-11 17:16:40 +0900
commita825f09dc8dba20e5a2f221c5d238fcf89202b54 (patch)
treed82db6d962bcac24ed7941cd3d9a197be52946b3
parentf84c2b30ed6991b5f6f70e3ab6a6fbdc0e56cf80 (diff)
downloadelementary-a825f09dc8dba20e5a2f221c5d238fcf89202b54.tar.gz
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
-rw-r--r--src/lib/elm_layout.c73
1 files changed, 38 insertions, 35 deletions
diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c
index 4fbb66abe..2abb20681 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;
}