From: ChunEon Park Date: Mon, 10 Sep 2012 10:38:02 +0000 (+0900) Subject: fixed plugin image size problem X-Git-Tag: 2.0_alpha^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2F2.0alpha;p=framework%2Fuifw%2Felementary.git fixed plugin image size problem Change-Id: Ia959d61324a86d8c136a3f3ebbb482817327374d --- diff --git a/packaging/elementary.spec b/packaging/elementary.spec index 4dd993b..493bfbe 100644 --- a/packaging/elementary.spec +++ b/packaging/elementary.spec @@ -1,7 +1,7 @@ #sbs-git:slp/pkgs/e/elementary elementary 1.0.0+svn.70492slp2+build11 Name: elementary Summary: EFL toolkit for small touchscreens -Version: 1.0.0+svn.70492slp2+build24 +Version: 1.0.0+svn.70492slp2+build25 Release: 1 Group: System/Libraries License: LGPLv2.1 diff --git a/src/lib/elm_plug.c b/src/lib/elm_plug.c index bf9db91..7150913 100644 --- a/src/lib/elm_plug.c +++ b/src/lib/elm_plug.c @@ -12,6 +12,7 @@ static const char *widtype = NULL; static void _del_hook(Evas_Object *obj); static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); +static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info); static const char SIG_CLICKED[] = "clicked"; @@ -37,6 +38,8 @@ _del_pre_hook(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; + if (!wd->img) return; + evas_object_event_callback_del_full(wd->img, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); evas_object_del(wd->img); } @@ -56,12 +59,25 @@ _sizing_eval(Evas_Object *obj) Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; if (!wd) return; + if (!wd->img) return; //TODO: get socket object size + + evas_object_size_hint_min_get(wd->img, &minw, &minh); + evas_object_size_hint_max_get(wd->img, &maxw, &maxh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, maxw, maxh); } static void +_changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) +{ + Widget_Data *wd = elm_widget_data_get(data); + if (!wd) return; + if (obj != wd->img) return; + _sizing_eval(data); +} + +static void _mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { evas_object_smart_callback_call(data, SIG_CLICKED, NULL); @@ -101,7 +117,8 @@ elm_plug_add(Evas_Object *parent) if (!ee) return NULL; wd->img = ecore_evas_extn_plug_new(ee); if (!wd->img) return NULL; - + evas_object_event_callback_add(wd->img, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_UP, _mouse_up, obj); elm_widget_resize_object_set(obj, wd->img);