raster pushed a commit to branch master.

commit 97ea0f87a63f871d349141854f742b8d6f41018a
Author: Thiep Ha <[email protected]>
Date:   Sat Jun 22 12:24:30 2013 +0900

    When mouse moves in longpress state, the cursor should be moved along
    with magnifier.
    
    Conflicts:
    
        ChangeLog
---
 ChangeLog           |  5 +++++
 NEWS                |  1 +
 src/lib/elm_entry.c | 19 ++++++++++++++++++-
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index fb9904b..e2ae0f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1437,3 +1437,8 @@
 2013-06-19  Jaehwan Kim
 
         * Fix elm_scroller_page_show bug. It have to save the wanted values to 
show the wanted page.
+
+2013-06-22 Thiep Ha
+
+        * Move cursor when mouse moves with longpress.
+
diff --git a/NEWS b/NEWS
index 468be13..d8e48f1 100644
--- a/NEWS
+++ b/NEWS
@@ -114,6 +114,7 @@ Improvements:
    * Ctxpopup is now supporting focus_direction.
    * Don't try to pop the naviframe item multiple times.
    * Support language change for widget items (Ctxpopup, Hoversel, Naviframe, 
Diskselector, List, Menu, Segment_Control, Toolbar, Popup, MultibuttonEntry)
+   * Move cursor when mouse moves with longpress.
 
 Fixes:
    * Now elm_datetime_field_limit_set() can set year limits wihtout problems.
diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c
index 8008100..9991a6d 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -1547,7 +1547,24 @@ _mouse_move_cb(void *data,
    if (ev->buttons == 1)
      {
         if ((sd->long_pressed) && (_elm_config->magnifier_enable))
-          _magnifier_move(data, ev->cur.canvas.x, ev->cur.canvas.y);
+          {
+             Evas_Coord x, y;
+             Eina_Bool rv;
+
+             evas_object_geometry_get(sd->entry_edje, &x, &y, NULL, NULL);
+             rv = edje_object_part_text_cursor_coord_set
+               (sd->entry_edje, "elm.text", EDJE_CURSOR_USER,
+               ev->cur.canvas.x - x, ev->cur.canvas.y - y);
+             if (rv)
+               {
+                  edje_object_part_text_cursor_copy
+                    (sd->entry_edje, "elm.text", EDJE_CURSOR_USER, 
EDJE_CURSOR_MAIN);
+               }
+             else
+               WRN("Warning: Cannot move cursor");
+
+             _magnifier_move(data, ev->cur.canvas.x, ev->cur.canvas.y);
+          }
      }
    if (!sd->sel_mode)
      {

-- 

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

Reply via email to