forked from enlightenment/efl
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
This commit is contained in:
parent
0ee28f12e1
commit
41106fe20f
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue