edje/edje_entry : When selected word exists, selection is cleared and cursor remains on the current entry by additional key input.

This commit is contained in:
WooHyun Jung 2013-04-22 23:34:25 +09:00
parent 529e1d3569
commit beba98895a
4 changed files with 48 additions and 10 deletions

View File

@ -1,3 +1,8 @@
2013-04-22 WooHyun Jung
* Edje: When selected word exists, selection is cleared and cursor
remains on the current edje_entry by additional key input.
2013-04-19 Jihoon Kim (jihoon)
* Edje: Remove code to call ecore_imf_context_reset in case of pressing ESC, Return key

1
NEWS
View File

@ -251,3 +251,4 @@ Fixes:
* Evas: If an object goes to be hidden without replacing the cur/prev state info, the object context can be corrupted at the next show time. Now it replaces the cur/prev in that rare case.
* Evas: Fix evas gl_x11 in 16bpp and lower depths than 24/32 bpp.
* Edje: Fix useless ecore_imf_context_reset call in case of pressing ESC and Return key
* Edje: When selected word exists, selection is cleared and cursor remains on the current entry by additional key input.

View File

@ -0,0 +1,7 @@
import sys
eodir = '/usr/local/share/eo/gdb'
if not eodir in sys.path:
sys.path.insert(0, eodir)
import eo_gdb

View File

@ -464,18 +464,15 @@ _curs_jump_line(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en, int ln)
Evas_Coord lx, ly, lw, lh;
int last = _curs_line_last_get(c, o, en);
if (ln < 0) ln = 0;
else
{
if (ln > last) ln = last;
}
if (ln < 0) return EINA_FALSE;
if (ln > last) return EINA_FALSE;
_curs_update_from_curs(c, o, en, &cx, &cy);
if (!evas_object_textblock_line_number_geometry_get(o, ln, &lx, &ly, &lw, &lh))
return EINA_FALSE;
if (evas_textblock_cursor_char_coord_set(c, cx, ly + (lh / 2)))
return EINA_FALSE;
return EINA_TRUE;
evas_textblock_cursor_line_set(c, ln);
if (cx < (lx + (lw / 2)))
{
@ -1340,9 +1337,16 @@ _edje_key_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
_compose_seq_reset(en);
if (multiline)
{
if (en->have_selection &&
(evas_textblock_cursor_pos_get(en->sel_start) != evas_textblock_cursor_pos_get(en->sel_end)))
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
if (en->select_allow)
{
if (shift) _sel_start(en->cursor, rp->object, en);
if (shift)
{
_sel_start(en->cursor, rp->object, en);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else _sel_clear(ed, en->cursor, rp->object, en);
}
if (_curs_up(en->cursor, rp->object, en))
@ -1362,9 +1366,16 @@ _edje_key_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
_compose_seq_reset(en);
if (multiline)
{
if (en->have_selection &&
(evas_textblock_cursor_pos_get(en->sel_start) != evas_textblock_cursor_pos_get(en->sel_end)))
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
if (en->select_allow)
{
if (shift) _sel_start(en->cursor, rp->object, en);
if (shift)
{
_sel_start(en->cursor, rp->object, en);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else _sel_clear(ed, en->cursor, rp->object, en);
}
if (_curs_down(en->cursor, rp->object, en))
@ -1382,9 +1393,16 @@ _edje_key_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
(!strcmp(ev->keyname, "KP_Left") && !ev->string))
{
_compose_seq_reset(en);
if (en->have_selection &&
(evas_textblock_cursor_pos_get(en->sel_start) != evas_textblock_cursor_pos_get(en->sel_end)))
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
if (en->select_allow)
{
if (shift) _sel_start(en->cursor, rp->object, en);
if (shift)
{
_sel_start(en->cursor, rp->object, en);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else _sel_clear(ed, en->cursor, rp->object, en);
}
if (evas_textblock_cursor_char_prev(en->cursor))
@ -1403,9 +1421,16 @@ _edje_key_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
(!strcmp(ev->keyname, "KP_Right") && !ev->string))
{
_compose_seq_reset(en);
if (en->have_selection &&
(evas_textblock_cursor_pos_get(en->sel_start) != evas_textblock_cursor_pos_get(en->sel_end)))
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
if (en->select_allow)
{
if (shift) _sel_start(en->cursor, rp->object, en);
if (shift)
{
_sel_start(en->cursor, rp->object, en);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
else _sel_clear(ed, en->cursor, rp->object, en);
}
/* If control is pressed, go to the end of the word */