summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWooHyun Jung <woohyun0705@gmail.com>2013-01-16 04:40:51 +0000
committerWooHyun Jung <woohyun0705@gmail.com>2013-01-16 04:40:51 +0000
commit14f28909fa79fc19580b285c815b1316f2be7f5e (patch)
treeeead39c09142a1bfc66810458f039324edd8f609
parentdf622561f3d3b0a3ecdbe18d9fd988c435c2f0bf (diff)
elementary/focus : Now, widget itself is the object which gets mouse_up event for stealing focus from another object.
By this change, a widget with scroller interface can change its focus state before adding parent class. SVN revision: 82853
-rw-r--r--ChangeLog4
-rw-r--r--src/lib/elm_widget.c60
2 files changed, 35 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index 9d3345eb5..026b6d831 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -910,3 +910,7 @@
9102013-01-16 WooHyun Jung 9102013-01-16 WooHyun Jung
911 911
912 * elm_plug should call elm_widget_can_focus_set after adding parent class. 912 * elm_plug should call elm_widget_can_focus_set after adding parent class.
913
9142013-01-16 WooHyun Jung
915
916 * Now, widget itself is the object which gets mouse_up event for stealing focus from another object. By this change, a widget with scroller interface can change its focus state before mouse_up of hit_rect.
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index f6e34e5be..5931f0cd5 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -485,10 +485,10 @@ _elm_widget_focus_direction_manager_is(const Evas_Object *obj)
485} 485}
486 486
487static void 487static void
488_sub_obj_mouse_down(void *data, 488_obj_mouse_down(void *data,
489 Evas *e __UNUSED__, 489 Evas *e __UNUSED__,
490 Evas_Object *obj __UNUSED__, 490 Evas_Object *obj __UNUSED__,
491 void *event_info) 491 void *event_info)
492{ 492{
493 Elm_Widget_Smart_Data *sd = data; 493 Elm_Widget_Smart_Data *sd = data;
494 Evas_Event_Mouse_Down *ev = event_info; 494 Evas_Event_Mouse_Down *ev = event_info;
@@ -497,10 +497,10 @@ _sub_obj_mouse_down(void *data,
497} 497}
498 498
499static void 499static void
500_sub_obj_mouse_move(void *data, 500_obj_mouse_move(void *data,
501 Evas *e __UNUSED__, 501 Evas *e __UNUSED__,
502 Evas_Object *obj, 502 Evas_Object *obj,
503 void *event_info) 503 void *event_info)
504{ 504{
505 Elm_Widget_Smart_Data *sd = data; 505 Elm_Widget_Smart_Data *sd = data;
506 Evas_Event_Mouse_Move *ev = event_info; 506 Evas_Event_Mouse_Move *ev = event_info;
@@ -520,10 +520,10 @@ _sub_obj_mouse_move(void *data,
520} 520}
521 521
522static void 522static void
523_sub_obj_mouse_up(void *data, 523_obj_mouse_up(void *data,
524 Evas *e __UNUSED__, 524 Evas *e __UNUSED__,
525 Evas_Object *obj, 525 Evas_Object *obj,
526 void *event_info __UNUSED__) 526 void *event_info __UNUSED__)
527{ 527{
528 Elm_Widget_Smart_Data *sd = data; 528 Elm_Widget_Smart_Data *sd = data;
529 if (sd->still_in) 529 if (sd->still_in)
@@ -1181,16 +1181,6 @@ _elm_widget_resize_object_set(Eo *obj, void *_pd, va_list *list)
1181 if (sd->resize_obj) 1181 if (sd->resize_obj)
1182 { 1182 {
1183 evas_object_clip_unset(sd->resize_obj); 1183 evas_object_clip_unset(sd->resize_obj);
1184
1185 evas_object_event_callback_del_full(sd->resize_obj,
1186 EVAS_CALLBACK_MOUSE_DOWN,
1187 _sub_obj_mouse_down, sd);
1188 evas_object_event_callback_del_full(sd->resize_obj,
1189 EVAS_CALLBACK_MOUSE_MOVE,
1190 _sub_obj_mouse_move, sd);
1191 evas_object_event_callback_del_full(sd->resize_obj,
1192 EVAS_CALLBACK_MOUSE_UP,
1193 _sub_obj_mouse_up, sd);
1194 evas_object_smart_member_del(sd->resize_obj); 1184 evas_object_smart_member_del(sd->resize_obj);
1195 1185
1196 if (_elm_widget_is(sd->resize_obj)) 1186 if (_elm_widget_is(sd->resize_obj))
@@ -1202,7 +1192,19 @@ _elm_widget_resize_object_set(Eo *obj, void *_pd, va_list *list)
1202 } 1192 }
1203 1193
1204 sd->resize_obj = sobj; 1194 sd->resize_obj = sobj;
1205 if (!sobj) return; 1195 if (!sobj)
1196 {
1197 evas_object_event_callback_del_full(obj,
1198 EVAS_CALLBACK_MOUSE_DOWN,
1199 _obj_mouse_down, sd);
1200 evas_object_event_callback_del_full(obj,
1201 EVAS_CALLBACK_MOUSE_MOVE,
1202 _obj_mouse_move, sd);
1203 evas_object_event_callback_del_full(obj,
1204 EVAS_CALLBACK_MOUSE_UP,
1205 _obj_mouse_up, sd);
1206 return;
1207 }
1206 1208
1207 // orphan new resize obj 1209 // orphan new resize obj
1208 parent = evas_object_data_get(sobj, "elm-parent"); 1210 parent = evas_object_data_get(sobj, "elm-parent");
@@ -1224,12 +1226,12 @@ _elm_widget_resize_object_set(Eo *obj, void *_pd, va_list *list)
1224 1226
1225 evas_object_smart_member_add(sobj, obj); 1227 evas_object_smart_member_add(sobj, obj);
1226 1228
1227 evas_object_event_callback_add(sobj, EVAS_CALLBACK_MOUSE_DOWN, 1229 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN,
1228 _sub_obj_mouse_down, sd); 1230 _obj_mouse_down, sd);
1229 evas_object_event_callback_add(sobj, EVAS_CALLBACK_MOUSE_MOVE, 1231 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_MOVE,
1230 _sub_obj_mouse_move, sd); 1232 _obj_mouse_move, sd);
1231 evas_object_event_callback_add(sobj, EVAS_CALLBACK_MOUSE_UP, 1233 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP,
1232 _sub_obj_mouse_up, sd); 1234 _obj_mouse_up, sd);
1233 _smart_reconfigure(sd); 1235 _smart_reconfigure(sd);
1234} 1236}
1235 1237