summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/edje/edje_entry.c')
-rw-r--r--src/lib/edje/edje_entry.c45
1 files changed, 35 insertions, 10 deletions
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index f6611da..193f712 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -464,18 +464,15 @@ _curs_jump_line(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en, int ln)
464 Evas_Coord lx, ly, lw, lh; 464 Evas_Coord lx, ly, lw, lh;
465 int last = _curs_line_last_get(c, o, en); 465 int last = _curs_line_last_get(c, o, en);
466 466
467 if (ln < 0) ln = 0; 467 if (ln < 0) return EINA_FALSE;
468 else 468 if (ln > last) return EINA_FALSE;
469 {
470 if (ln > last) ln = last;
471 }
472 469
473 _curs_update_from_curs(c, o, en, &cx, &cy); 470 _curs_update_from_curs(c, o, en, &cx, &cy);
474 471
475 if (!evas_object_textblock_line_number_geometry_get(o, ln, &lx, &ly, &lw, &lh)) 472 if (!evas_object_textblock_line_number_geometry_get(o, ln, &lx, &ly, &lw, &lh))
476 return EINA_FALSE; 473 return EINA_FALSE;
477 if (evas_textblock_cursor_char_coord_set(c, cx, ly + (lh / 2))) 474 if (evas_textblock_cursor_char_coord_set(c, cx, ly + (lh / 2)))
478 return EINA_FALSE; 475 return EINA_TRUE;
479 evas_textblock_cursor_line_set(c, ln); 476 evas_textblock_cursor_line_set(c, ln);
480 if (cx < (lx + (lw / 2))) 477 if (cx < (lx + (lw / 2)))
481 { 478 {
@@ -1340,9 +1337,16 @@ _edje_key_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
1340 _compose_seq_reset(en); 1337 _compose_seq_reset(en);
1341 if (multiline) 1338 if (multiline)
1342 { 1339 {
1340 if (en->have_selection &&
1341 (evas_textblock_cursor_pos_get(en->sel_start) != evas_textblock_cursor_pos_get(en->sel_end)))
1342 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1343 if (en->select_allow) 1343 if (en->select_allow)
1344 { 1344 {
1345 if (shift) _sel_start(en->cursor, rp->object, en); 1345 if (shift)
1346 {
1347 _sel_start(en->cursor, rp->object, en);
1348 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1349 }
1346 else _sel_clear(ed, en->cursor, rp->object, en); 1350 else _sel_clear(ed, en->cursor, rp->object, en);
1347 } 1351 }
1348 if (_curs_up(en->cursor, rp->object, en)) 1352 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,
1362 _compose_seq_reset(en); 1366 _compose_seq_reset(en);
1363 if (multiline) 1367 if (multiline)
1364 { 1368 {
1369 if (en->have_selection &&
1370 (evas_textblock_cursor_pos_get(en->sel_start) != evas_textblock_cursor_pos_get(en->sel_end)))
1371 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1365 if (en->select_allow) 1372 if (en->select_allow)
1366 { 1373 {
1367 if (shift) _sel_start(en->cursor, rp->object, en); 1374 if (shift)
1375 {
1376 _sel_start(en->cursor, rp->object, en);
1377 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1378 }
1368 else _sel_clear(ed, en->cursor, rp->object, en); 1379 else _sel_clear(ed, en->cursor, rp->object, en);
1369 } 1380 }
1370 if (_curs_down(en->cursor, rp->object, en)) 1381 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,
1382 (!strcmp(ev->keyname, "KP_Left") && !ev->string)) 1393 (!strcmp(ev->keyname, "KP_Left") && !ev->string))
1383 { 1394 {
1384 _compose_seq_reset(en); 1395 _compose_seq_reset(en);
1396 if (en->have_selection &&
1397 (evas_textblock_cursor_pos_get(en->sel_start) != evas_textblock_cursor_pos_get(en->sel_end)))
1398 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1385 if (en->select_allow) 1399 if (en->select_allow)
1386 { 1400 {
1387 if (shift) _sel_start(en->cursor, rp->object, en); 1401 if (shift)
1402 {
1403 _sel_start(en->cursor, rp->object, en);
1404 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1405 }
1388 else _sel_clear(ed, en->cursor, rp->object, en); 1406 else _sel_clear(ed, en->cursor, rp->object, en);
1389 } 1407 }
1390 if (evas_textblock_cursor_char_prev(en->cursor)) 1408 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,
1403 (!strcmp(ev->keyname, "KP_Right") && !ev->string)) 1421 (!strcmp(ev->keyname, "KP_Right") && !ev->string))
1404 { 1422 {
1405 _compose_seq_reset(en); 1423 _compose_seq_reset(en);
1424 if (en->have_selection &&
1425 (evas_textblock_cursor_pos_get(en->sel_start) != evas_textblock_cursor_pos_get(en->sel_end)))
1426 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1406 if (en->select_allow) 1427 if (en->select_allow)
1407 { 1428 {
1408 if (shift) _sel_start(en->cursor, rp->object, en); 1429 if (shift)
1430 {
1431 _sel_start(en->cursor, rp->object, en);
1432 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1433 }
1409 else _sel_clear(ed, en->cursor, rp->object, en); 1434 else _sel_clear(ed, en->cursor, rp->object, en);
1410 } 1435 }
1411 /* If control is pressed, go to the end of the word */ 1436 /* If control is pressed, go to the end of the word */