Yep, adding an hit-rect doesn't sound right.
On Tue, Nov 27, 2012 at 10:44 AM, Gustavo Sverzut Barbieri < [email protected]> wrote: > Why is that? I don't get why the rect must be added if it worked before. > Just change the member add to set the properties you need > > On Tuesday, November 27, 2012, Enlightenment SVN wrote: > > > Log: > > Add the hit_rect in elm_image. When the image is changed, the evas > > callback cannot be called. > > So hit_rect gets the mouse events in a top of the widget. > > > > > > Author: jaehwan > > Date: 2012-11-27 01:29:16 -0800 (Tue, 27 Nov 2012) > > New Revision: 79740 > > Trac: http://trac.enlightenment.org/e/changeset/79740 > > > > Modified: > > trunk/elementary/src/lib/elm_image.c > > trunk/elementary/src/lib/elm_widget_image.h > > > > Modified: trunk/elementary/src/lib/elm_image.c > > =================================================================== > > --- trunk/elementary/src/lib/elm_image.c 2012-11-27 09:07:42 UTC > > (rev 79739) > > +++ trunk/elementary/src/lib/elm_image.c 2012-11-27 09:29:16 UTC > > (rev 79740) > > @@ -172,6 +172,8 @@ > > evas_object_image_fill_set(sd->img, 0, 0, w, h); > > evas_object_resize(sd->img, w, h); > > } > > + evas_object_move(sd->hit_rect, x, y); > > + evas_object_resize(sd->hit_rect, w, h); > > } > > > > static void > > @@ -626,6 +628,17 @@ > > > > Elm_Image_Smart_Data *priv = _pd; > > > > + priv->hit_rect = > evas_object_rectangle_add(evas_object_evas_get(obj)); > > + evas_object_smart_member_add(priv->hit_rect, obj); > > + elm_widget_sub_object_add(obj, priv->hit_rect); > > + > > + evas_object_color_set(priv->hit_rect, 0, 0, 0, 0); > > + evas_object_show(priv->hit_rect); > > + evas_object_repeat_events_set(priv->hit_rect, EINA_TRUE); > > + > > + evas_object_event_callback_add > > + (priv->hit_rect, EVAS_CALLBACK_MOUSE_UP, _on_mouse_up, obj); > > + > > /* starts as an Evas image. may switch to an Edje object */ > > priv->img = _img_new(obj); > > priv->prev_img = NULL; > > @@ -728,6 +741,18 @@ > > } > > > > static void > > +_elm_image_smart_member_add(Eo *obj, void *_pd, va_list *list > EINA_UNUSED) > > +{ > > + Evas_Object *member = va_arg(*list, Evas_Object *); > > + Elm_Image_Smart_Data *sd = _pd; > > + > > + eo_do_super(obj, evas_obj_smart_member_add(member)); > > + > > + if (sd->hit_rect) > > + evas_object_raise(sd->hit_rect); > > +} > > + > > +static void > > _elm_image_smart_color_set(Eo *obj, void *_pd, va_list *list) > > { > > Elm_Image_Smart_Data *sd = _pd; > > @@ -1511,6 +1536,7 @@ > > EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), > > _elm_image_smart_move), > > EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), > > _elm_image_smart_show), > > EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE), > > _elm_image_smart_hide), > > + EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MEMBER_ADD), > > _elm_image_smart_member_add), > > EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_COLOR_SET), > > _elm_image_smart_color_set), > > EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CLIP_SET), > > _elm_image_smart_clip_set), > > EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CLIP_UNSET), > > _elm_image_smart_clip_unset), > > > > Modified: trunk/elementary/src/lib/elm_widget_image.h > > =================================================================== > > --- trunk/elementary/src/lib/elm_widget_image.h 2012-11-27 09:07:42 UTC > > (rev 79739) > > +++ trunk/elementary/src/lib/elm_widget_image.h 2012-11-27 09:29:16 UTC > > (rev 79740) > > @@ -28,6 +28,7 @@ > > typedef struct _Elm_Image_Smart_Data Elm_Image_Smart_Data; > > struct _Elm_Image_Smart_Data > > { > > + Evas_Object *hit_rect; > > Evas_Object *img; > > Evas_Object *prev_img; > > > > > > > > > > > ------------------------------------------------------------------------------ > > Monitor your physical, virtual and cloud infrastructure from a single > > web console. Get in-depth insight into apps, servers, databases, vmware, > > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > > Pricing starts from $795 for 25 servers or applications! > > http://p.sf.net/sfu/zoho_dev2dev_nov > > _______________________________________________ > > enlightenment-svn mailing list > > [email protected] <javascript:;> > > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > > > > > -- > Gustavo Sverzut Barbieri > http://profusion.mobi embedded systems > -------------------------------------- > MSN: [email protected] > Skype: gsbarbieri > Mobile: +55 (19) 9225-2202 > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > enlightenment-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > -- Tom. ------------------------------------------------------------------------------ Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
