+ sd->still_in = 1;
Please use EINA_TRUE/FALSE
------------------------------------
-Regards, Hermet-
-----Original Message-----
From: "Enlightenment SVN"<[email protected]>
To: [email protected]
Cc:
Sent: 11-10-31(월) 17:26:12
Subject: E SVN: woohyun trunk/elementary/src/lib
Log:
elementary/elm_widget : Focus should be moved by "clicked" not by
"mouse_up". So modified about this.
Author: woohyun
Date: 2011-10-31 01:26:12 -0700 (Mon, 31 Oct 2011)
New Revision: 64548
Trac: http://trac.enlightenment.org/e/changeset/64548
Modified:
trunk/elementary/src/lib/elm_widget.c
Modified: trunk/elementary/src/lib/elm_widget.c
===================================================================
--- trunk/elementary/src/lib/elm_widget.c 2011-10-31 07:20:53 UTC (rev 64547)
+++ trunk/elementary/src/lib/elm_widget.c 2011-10-31 08:26:12 UTC (rev 64548)
@@ -114,6 +114,7 @@
Eina_Bool disabled : 1;
Eina_Bool is_mirrored : 1;
Eina_Bool mirrored_auto_mode : 1; /* This is TRUE by default */
+ Eina_Bool still_in : 1;
Eina_List *focus_chain;
Eina_List *event_cb;
@@ -244,14 +245,50 @@
}
static void
-_sub_obj_mouse_up(void *data __UNUSED__,
+_sub_obj_mouse_down(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info)
+{
+ Smart_Data *sd = data;
+ Evas_Event_Mouse_Down *ev = event_info;
+ if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
+ sd->still_in = 1;
+}
+
+static void
+_sub_obj_mouse_move(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj,
+ void *event_info)
+{
+ Smart_Data *sd = data;
+ Evas_Event_Mouse_Move *ev = event_info;
+ if (sd->still_in)
+ {
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
+ sd->still_in = 0;
+ else
+ {
+ Evas_Coord x, y, w, h;
+ evas_object_geometry_get(obj, &x, &y, &w, &h);
+ if ((ev->cur.canvas.x < x) || (ev->cur.canvas.y < y) ||
+ (ev->cur.canvas.x >= (x + w)) || (ev->cur.canvas.y >= (y + h)))
+ sd->still_in = 0;
+ }
+ }
+}
+
+static void
+_sub_obj_mouse_up(void *data,
Evas *e __UNUSED__,
Evas_Object *obj,
- void *event_info)
+ void *event_info __UNUSED__)
{
- Evas_Event_Mouse_Up *ev = event_info;
- if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
- elm_widget_focus_mouse_up_handle(obj);
+ Smart_Data *sd = data;
+ if (sd->still_in)
+ elm_widget_focus_mouse_up_handle(obj);
+ sd->still_in = 0;
}
static void
@@ -1002,6 +1039,10 @@
}
evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_DEL,
_sub_obj_del, sd);
+ evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_MOUSE_DOWN,
+ _sub_obj_mouse_down, sd);
+ evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_MOUSE_MOVE,
+ _sub_obj_mouse_move, sd);
evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_MOUSE_UP,
_sub_obj_mouse_up, sd);
evas_object_smart_member_del(sd->resize_obj);
@@ -1025,6 +1066,10 @@
}
evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_DEL,
_sub_obj_del, sd);
+ evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_MOUSE_DOWN,
+ _sub_obj_mouse_down, sd);
+ evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_MOUSE_MOVE,
+ _sub_obj_mouse_move, sd);
evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_MOUSE_UP,
_sub_obj_mouse_up, sd);
evas_object_smart_member_del(sobj);
@@ -1049,6 +1094,10 @@
evas_object_smart_member_add(sobj, obj);
evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL,
_sub_obj_del, sd);
+ evas_object_event_callback_add(sobj, EVAS_CALLBACK_MOUSE_DOWN,
+ _sub_obj_mouse_down, sd);
+ evas_object_event_callback_add(sobj, EVAS_CALLBACK_MOUSE_MOVE,
+ _sub_obj_mouse_move, sd);
evas_object_event_callback_add(sobj, EVAS_CALLBACK_MOUSE_UP,
_sub_obj_mouse_up, sd);
_smart_reconfigure(sd);
------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook
in minutes. BlackBerry App World™ now supports Android™ Apps
for the BlackBerry® PlayBook™. Discover just how easy and simple
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
enlightenment-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook
in minutes. BlackBerry App World™ now supports Android™ Apps
for the BlackBerry® PlayBook™. Discover just how easy and simple
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel