hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=fe0a67bf9cc5316b9ab419708f8f39dda0948d8b

commit fe0a67bf9cc5316b9ab419708f8f39dda0948d8b
Author: ChunEon Park <her...@hermet.pe.kr>
Date:   Fri Aug 15 17:54:03 2014 +0900

    edc_editor: update selection area when image preview goes prev/next.
---
 src/bin/edc_editor.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/bin/edc_editor.c b/src/bin/edc_editor.c
index 07840b0..81b9b8b 100644
--- a/src/bin/edc_editor.c
+++ b/src/bin/edc_editor.c
@@ -438,8 +438,26 @@ preview_img_relay_show(edit_data *ed, Evas_Object 
*ctxpopup, Eina_Bool next)
         /* Since the ctxpopup will be shown again,
            Don't revert the focus in the dismiss cb. */
         evas_object_data_set(ctxpopup, "continue", (void *) 1);
-     }
 
+        //Set the entry selection region to next image.
+        const char *colon = parser_colon_pos_get(NULL, text);
+        if (!colon) goto end;
+
+        const char *select = elm_entry_selection_get(ed->en_edit);
+        if (!select) goto end;
+
+        char *select_utf8 = elm_entry_markup_to_utf8(select);
+        if (!select_utf8) goto end;
+        int select_len = strlen(select_utf8);
+        free(select_utf8);
+        const char *p = (colon - select_len);
+        if (p < text) goto end;
+
+        int cursor_pos = elm_entry_cursor_pos_get(ed->en_edit);
+        elm_entry_select_region_set(ed->en_edit, (cursor_pos - select_len),
+                                    cursor_pos);
+     }
+end:
    menu_ctxpopup_unregister(ctxpopup);
    elm_ctxpopup_dismiss(ctxpopup);
 }

-- 


Reply via email to