From: discomfitor Date: Wed, 4 Jan 2012 05:14:30 +0000 (+0000) Subject: massive throttling for frame animation X-Git-Tag: REL_F_I9500_20120323_1~17^2~939 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e15fec5c18b289b6ec005353d142dde559ee98dd;p=framework%2Fuifw%2Felementary.git massive throttling for frame animation git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@66847 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/elm_frame.c b/src/lib/elm_frame.c index 34ccba3..9505804 100644 --- a/src/lib/elm_frame.c +++ b/src/lib/elm_frame.c @@ -10,6 +10,7 @@ struct _Widget_Data const char *label; Eina_Bool collapsed : 1; Eina_Bool collapsible : 1; + Eina_Bool anim : 1; }; static const char SIG_CLICKED[] = "clicked"; @@ -79,8 +80,15 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1; + Evas_Coord cminw = -1, cminh = -1; + static int x; if (!wd) return; + if (wd->anim) + if (x++ != 40) return; + x = 0; edje_object_size_min_calc(wd->frm, &minw, &minh); + evas_object_size_hint_min_get(obj, &cminw, &cminh); + if ((minw == cminw) && (minh == cminh)) return; evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, -1, -1); } @@ -200,6 +208,8 @@ _recalc_done(Evas_Object *fr, Evas_Object *obj __UNUSED__, void *event_info __UN wd = elm_widget_data_get(fr); if (!wd) return; evas_object_smart_callback_del(wd->frm, "recalc", (Evas_Smart_Cb)_recalc); + wd->anim = EINA_FALSE; + _sizing_eval(fr); } static void @@ -213,6 +223,7 @@ _signal_click(Evas_Object *fr, Evas_Object *obj __UNUSED__, const char *emission evas_object_smart_callback_add(wd->frm, "recalc", (Evas_Smart_Cb)_recalc, fr); edje_object_signal_emit(wd->frm, "elm,action,collapse", "elm"); wd->collapsed++; + wd->anim = EINA_TRUE; } EAPI Evas_Object * @@ -285,6 +296,7 @@ elm_frame_collapse_set(Evas_Object *obj, Eina_Bool enable) edje_object_signal_emit(wd->frm, "elm,action,collapse", "elm"); evas_object_smart_callback_add(wd->frm, "recalc", (Evas_Smart_Cb)_recalc, obj); wd->collapsed = enable; + wd->anim = EINA_TRUE; } EAPI Eina_Bool