From c186d95758feb553042029a8cd7a8790ea4fa05a Mon Sep 17 00:00:00 2001 From: Myungjae Lee Date: Tue, 28 Sep 2010 17:34:58 +0900 Subject: [PATCH] [entry] fixed bugs in entry copy paste popup --- src/lib/elm_entry.c | 22 ++++++++++++++++++---- src/modules/ctxpopup_copypasteUI/copypaste.c | 12 ++---------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 7efc7e3..dd07c9c 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -130,6 +130,7 @@ struct _Widget_Data Eina_Bool selmode : 1; Eina_Bool deferred_cur : 1; Eina_Bool disabled : 1; + Eina_Bool double_clicked : 1; Eina_Bool context_menu : 1; Eina_Bool drag_selection_asked : 1; Eina_Bool bgcolor : 1; @@ -659,6 +660,13 @@ _long_press(void *data) const Eina_List *l; const Elm_Entry_Context_Menu_Item *it; if (!wd) return ECORE_CALLBACK_CANCEL; + + if (wd->longpress_timer) + { + ecore_timer_del(wd->longpress_timer); + wd->longpress_timer = NULL; + } + if ((wd->api) && (wd->api->obj_longpress)) { wd->api->obj_longpress(data); @@ -759,10 +767,14 @@ _mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void * Evas_Event_Mouse_Up *ev = event_info; if (!wd) return; if (ev->button != 1) return; - if ((wd->api) && (wd->api->obj_mouseup)) - { - wd->api->obj_mouseup(data); - } + + if (!wd->double_clicked) + { + if ((wd->api) && (wd->api->obj_mouseup)) + { + wd->api->obj_mouseup(data); + } + } if (wd->longpress_timer) { ecore_timer_del(wd->longpress_timer); @@ -1337,6 +1349,7 @@ _signal_mouse_down(void *data, Evas_Object *obj __UNUSED__, const char *emission { Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; + wd->double_clicked = EINA_FALSE; evas_object_smart_callback_call(data, SIG_PRESS, NULL); } @@ -1353,6 +1366,7 @@ _signal_mouse_double(void *data, Evas_Object *obj __UNUSED__, const char *emissi { Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; + wd->double_clicked = EINA_TRUE; evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, NULL); } diff --git a/src/modules/ctxpopup_copypasteUI/copypaste.c b/src/modules/ctxpopup_copypasteUI/copypaste.c index e936d88..aeccb07 100644 --- a/src/modules/ctxpopup_copypasteUI/copypaste.c +++ b/src/modules/ctxpopup_copypasteUI/copypaste.c @@ -121,7 +121,7 @@ obj_unhook(Evas_Object *obj) EAPI void obj_longpress(Evas_Object *obj) -{ +{ if(!ext_mod) return; Evas_Object *top; const Eina_List *l; @@ -138,7 +138,7 @@ obj_longpress(Evas_Object *obj) if(top) ext_mod->popup = elm_ctxpopup_add(top); /*currently below theme not used,when guideline comes a new theme can be created if required*/ - //elm_object_style_set(ext_mod->popup,"entry"); + elm_object_style_set(ext_mod->popup,"extended/entry"); elm_ctxpopup_scroller_disabled_set(ext_mod->popup, EINA_TRUE); context_menu_orientation = edje_object_data_get (ext_mod->ent, "context_menu_orientation"); @@ -203,7 +203,6 @@ obj_longpress(Evas_Object *obj) EAPI void obj_mouseup(Evas_Object *obj) { - if (!obj || !ext_mod) { return; } @@ -217,13 +216,6 @@ obj_mouseup(Evas_Object *obj) _cancel(obj,ext_mod->popup,NULL); } } - else - { - if (ext_mod->have_selection ) - { - obj_longpress( obj ); - } - } } -- 2.7.4