From 97c6cc2d81147c47fe980d62c25aa68b660be5a6 Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Thu, 21 Feb 2013 05:57:05 +0000 Subject: [PATCH] elementary/button,label,bg - i have no idea but elm_layout_theme_set() should be called in smart_add(). this fixes the hoversel. SVN revision: 84275 --- legacy/elementary/src/lib/elm_bg.c | 10 ++++------ legacy/elementary/src/lib/elm_button.c | 12 ++++++------ legacy/elementary/src/lib/elm_label.c | 16 ++++++++-------- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/legacy/elementary/src/lib/elm_bg.c b/legacy/elementary/src/lib/elm_bg.c index 712f8db86f..db355b81aa 100644 --- a/legacy/elementary/src/lib/elm_bg.c +++ b/legacy/elementary/src/lib/elm_bg.c @@ -100,20 +100,19 @@ 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()); + 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); + elm_widget_can_focus_set(obj, EINA_FALSE); priv->option = ELM_BG_OPTION_SCALE; 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)); } @@ -138,7 +137,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)); - } static void diff --git a/legacy/elementary/src/lib/elm_button.c b/legacy/elementary/src/lib/elm_button.c index ffe06b74a0..c4ea81f1af 100644 --- a/legacy/elementary/src/lib/elm_button.c +++ b/legacy/elementary/src/lib/elm_button.c @@ -117,6 +117,7 @@ _elm_button_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list) Eina_Bool *ret = va_arg(*list, Eina_Bool *); if (ret) *ret = EINA_FALSE; Eina_Bool int_ret = EINA_FALSE; + eo_do_super(obj, elm_wdg_theme(&int_ret)); if (!int_ret) return; _icon_signal_emit(obj); @@ -293,6 +294,10 @@ _elm_button_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) eo_do_super(obj, evas_obj_smart_add()); + 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); + edje_object_signal_callback_add (wd->resize_obj, "elm,action,click", "", _on_clicked_signal, obj); @@ -312,6 +317,7 @@ _elm_button_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) (_elm_access_object_get(obj), ELM_ACCESS_STATE, _access_state_cb, priv); elm_widget_can_focus_set(obj, EINA_TRUE); + elm_layout_theme_set(obj, "button", "base", elm_widget_style_get(obj)); } static void @@ -344,12 +350,6 @@ _constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) eo_do(obj, evas_obj_type_set(MY_CLASS_NAME), evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL)); - - 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); - - elm_layout_theme_set(obj, "button", "base", elm_widget_style_get(obj)); } EAPI void diff --git a/legacy/elementary/src/lib/elm_label.c b/legacy/elementary/src/lib/elm_label.c index 0af94c0928..36ac627f8e 100644 --- a/legacy/elementary/src/lib/elm_label.c +++ b/legacy/elementary/src/lib/elm_label.c @@ -378,6 +378,10 @@ _elm_label_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) eo_do_super(obj, evas_obj_smart_add()); + 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); + priv->linewrap = ELM_WRAP_NONE; priv->wrap_w = -1; priv->slide_duration = 10; @@ -400,6 +404,10 @@ _elm_label_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) (_elm_access_object_get(obj), ELM_ACCESS_TYPE, E_("Label")); _elm_access_callback_set (_elm_access_object_get(obj), ELM_ACCESS_INFO, _access_info_cb, NULL); + + elm_layout_theme_set(obj, "label", "base", elm_widget_style_get(obj)); + elm_layout_text_set(obj, NULL, "
"); + elm_layout_sizing_eval(obj); } EAPI Evas_Object * @@ -418,14 +426,6 @@ _constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) eo_do(obj, evas_obj_type_set(MY_CLASS_NAME), evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL)); - - 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); - - elm_layout_theme_set(obj, "label", "base", elm_widget_style_get(obj)); - elm_layout_text_set(obj, NULL, "
"); - elm_layout_sizing_eval(obj); } EAPI void