elementary/widgets - if the orient mode is changed, apply a default only if the style doesn't applied anything. other wise, use the preivouse one.

SVN revision: 84034
This commit is contained in:
ChunEon Park 2013-02-18 05:13:58 +00:00
parent 6fcab85ab0
commit ade43adfd9
2 changed files with 12 additions and 5 deletions

View File

@ -100,6 +100,7 @@ static void
_elm_bg_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Bg_Smart_Data *priv = _pd;
Evas_Object *parent;
eo_do_super(obj, evas_obj_smart_add());
@ -109,6 +110,10 @@ _elm_bg_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _on_resize, obj);
parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
elm_layout_theme_set(obj, "bg", "base", elm_widget_style_get(obj));
}
@ -134,9 +139,6 @@ _constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
eo_do_super(obj, eo_constructor());
eo_do(obj, evas_obj_type_set(MY_CLASS_NAME));
Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
}
static void

View File

@ -4094,12 +4094,17 @@ _elm_widget_theme_object_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
strncpy(buf, welement, sizeof(buf));
break;
}
printf("asdfasdfasdfasdfasdfasdf!\n");
ret2 = _elm_theme_object_set(obj, edj, wname, buf, wstyle);
}
//Fallback. Apply a default if the style doesnt applied anything.
//Otherwise, use the previous one.
if (!ret2)
{
//FIXME:For optimization, don't need to set to default when orientation mode is invalid.
ret2 = _elm_theme_object_set(obj, edj, wname, welement, wstyle);
if (!evas_object_data_get(edj, "edje,theme,watcher"))
ret2 = _elm_theme_object_set(obj, edj, wname, welement, wstyle);
else
ret2 = EINA_TRUE;
strncpy(buf, "elm,state,orient,0", sizeof(buf));
}
else