diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index cef7b1a4d9..b1986a4379 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -1566,3 +1566,10 @@ 2013-08-22 Thiep Ha * Add hide effect for notify. + +2013-08-22 ChunEon Park (Hermet) + + * Widget: Improve performance in applying widget theme. It prevents + applying themes more strictly if it tries to apply same theme. This + increases the performance hugely in case that user applies a specific + theme to the window object. diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index 2fac39ebab..92f42cf07f 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -128,6 +128,7 @@ Improvements: * Add support for URL in Elm_Image and Elm_Photocam. * Popup: Support "language,changed" smart callback. * Add hide effect for notify. + * Widget: Improve performance in applying widget theme. It prevents applying themes more strictly if it tries to apply same theme. This increases the performance hugely in case that user applies a specific theme to the window object. Fixes: * Now elm_datetime_field_limit_set() can set year limits wihtout problems. diff --git a/legacy/elementary/src/lib/elm_widget.c b/legacy/elementary/src/lib/elm_widget.c index 1b169ae792..d8fd8f4dff 100644 --- a/legacy/elementary/src/lib/elm_widget.c +++ b/legacy/elementary/src/lib/elm_widget.c @@ -1039,6 +1039,8 @@ _elm_widget_sub_object_add(Eo *obj, void *_pd, va_list *list) (sobj, EVAS_CALLBACK_DEL, _on_sub_obj_del, obj); if (_elm_widget_is(sobj)) { + ELM_WIDGET_DATA_GET(sobj, sdc); + evas_object_event_callback_add (sobj, EVAS_CALLBACK_HIDE, _on_sub_obj_hide, NULL); @@ -1046,7 +1048,8 @@ _elm_widget_sub_object_add(Eo *obj, void *_pd, va_list *list) th = elm_widget_theme_get(sobj); mirrored = elm_widget_mirrored_get(sobj); - if ((scale != pscale) || (th != pth) || (pmirrored != mirrored)) + if ((scale != pscale) || (!sdc->on_create && th != pth) || + (pmirrored != mirrored)) elm_widget_theme(sobj); if (elm_widget_focus_get(sobj)) _parents_focus(obj); @@ -3763,12 +3766,14 @@ _elm_widget_theme_set(Eo *obj, void *_pd, va_list *list) { Elm_Theme *th = va_arg(*list, Elm_Theme *); Elm_Widget_Smart_Data *sd = _pd; + Eina_Bool apply = EINA_FALSE; if (sd->theme != th) { + if (elm_widget_theme_get(obj) != th) apply = EINA_TRUE; if (sd->theme) elm_theme_free(sd->theme); sd->theme = th; if (th) th->ref++; - elm_widget_theme(obj); + if (apply) elm_widget_theme(obj); } } @@ -5875,9 +5880,13 @@ elm_widget_tree_dot_dump(const Evas_Object *top, static void _constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED) { + ELM_WIDGET_DATA_GET(obj, sd); + + sd->on_create = EINA_TRUE; eo_do_super(obj, MY_CLASS, eo_constructor()); eo_do(obj, evas_obj_type_set(MY_CLASS_NAME)); eo_do(obj, elm_wdg_parent_set(eo_parent_get(obj))); + sd->on_create = EINA_FALSE; } static void diff --git a/legacy/elementary/src/lib/elm_widget.h b/legacy/elementary/src/lib/elm_widget.h index 594580f85b..945ef9d90b 100644 --- a/legacy/elementary/src/lib/elm_widget.h +++ b/legacy/elementary/src/lib/elm_widget.h @@ -436,6 +436,7 @@ typedef struct _Elm_Widget_Smart_Data Eina_Bool highlighted : 1; Eina_Bool highlight_root : 1; Eina_Bool on_translate : 1; + Eina_Bool on_create : 1; } Elm_Widget_Smart_Data; /**