forked from enlightenment/efl
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:
parent
529e1d3569
commit
beba98895a
|
@ -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)
|
2013-04-19 Jihoon Kim (jihoon)
|
||||||
|
|
||||||
* Edje: Remove code to call ecore_imf_context_reset in case of pressing ESC, Return key
|
* Edje: Remove code to call ecore_imf_context_reset in case of pressing ESC, Return key
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -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: 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.
|
* 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: 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.
|
||||||
|
|
|
@ -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
|
|
@ -464,18 +464,15 @@ _curs_jump_line(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en, int ln)
|
||||||
Evas_Coord lx, ly, lw, lh;
|
Evas_Coord lx, ly, lw, lh;
|
||||||
int last = _curs_line_last_get(c, o, en);
|
int last = _curs_line_last_get(c, o, en);
|
||||||
|
|
||||||
if (ln < 0) ln = 0;
|
if (ln < 0) return EINA_FALSE;
|
||||||
else
|
if (ln > last) return EINA_FALSE;
|
||||||
{
|
|
||||||
if (ln > last) ln = last;
|
|
||||||
}
|
|
||||||
|
|
||||||
_curs_update_from_curs(c, o, en, &cx, &cy);
|
_curs_update_from_curs(c, o, en, &cx, &cy);
|
||||||
|
|
||||||
if (!evas_object_textblock_line_number_geometry_get(o, ln, &lx, &ly, &lw, &lh))
|
if (!evas_object_textblock_line_number_geometry_get(o, ln, &lx, &ly, &lw, &lh))
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
if (evas_textblock_cursor_char_coord_set(c, cx, ly + (lh / 2)))
|
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);
|
evas_textblock_cursor_line_set(c, ln);
|
||||||
if (cx < (lx + (lw / 2)))
|
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);
|
_compose_seq_reset(en);
|
||||||
if (multiline)
|
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 (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);
|
else _sel_clear(ed, en->cursor, rp->object, en);
|
||||||
}
|
}
|
||||||
if (_curs_up(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);
|
_compose_seq_reset(en);
|
||||||
if (multiline)
|
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 (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);
|
else _sel_clear(ed, en->cursor, rp->object, en);
|
||||||
}
|
}
|
||||||
if (_curs_down(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))
|
(!strcmp(ev->keyname, "KP_Left") && !ev->string))
|
||||||
{
|
{
|
||||||
_compose_seq_reset(en);
|
_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 (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);
|
else _sel_clear(ed, en->cursor, rp->object, en);
|
||||||
}
|
}
|
||||||
if (evas_textblock_cursor_char_prev(en->cursor))
|
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))
|
(!strcmp(ev->keyname, "KP_Right") && !ev->string))
|
||||||
{
|
{
|
||||||
_compose_seq_reset(en);
|
_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 (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);
|
else _sel_clear(ed, en->cursor, rp->object, en);
|
||||||
}
|
}
|
||||||
/* If control is pressed, go to the end of the word */
|
/* If control is pressed, go to the end of the word */
|
||||||
|
|
Loading…
Reference in New Issue