summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykyta Biliavskyi <m.biliavskyi@samsung.com>2015-08-20 11:31:27 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-08-20 11:31:27 +0900
commit41106fe20fe991e42633fbc9a9b7155db971cc90 (patch)
tree18e8820e55763bf27eda537abcef30e204c0314f
parent0ee28f12e188a9f8a73a3c6e857e6ec0812667ae (diff)
downloadefl-41106fe20fe991e42633fbc9a9b7155db971cc90.tar.gz
Edje_Entry: check selection before the cursor position change.
Summary: change position of the main textblock cursor in depends of the selection is present. Change cursor position to the start or end of selection only when selection is present. @fix Test Plan: Press "Up" and "Down" arrow keys on selected and normal text. For selected text: the entry cursor should be placed one line above or below selection block (in depends from pressed button). For normal text: the entry cursor should be placed one line above or below of the current cursor position. Reviewers: tasn, Hermet, herdsman Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2948
-rw-r--r--src/lib/edje/edje_entry.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index 8b4f256267..b7289b4cfe 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -1461,7 +1461,7 @@ _edje_key_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
_sel_start(en->cursor, rp->object, en);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
- else
+ else if (en->have_selection)
{
if (evas_textblock_cursor_compare(en->sel_start, en->sel_end) < 0)
evas_textblock_cursor_copy(en->sel_start, en->cursor);
@@ -1497,7 +1497,7 @@ _edje_key_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
_sel_start(en->cursor, rp->object, en);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
- else
+ else if (en->have_selection)
{
if (evas_textblock_cursor_compare(en->sel_start, en->sel_end) < 0)
evas_textblock_cursor_copy(en->sel_end, en->cursor);