Edc Editor: after dismissing candidate list, cursor is moved at the end of attribute.

After choose or hide the candidate, the entry cursor
is moved to the end of attribute string ';'. It is more natural
way, than was previously, when cursor was placed before ':'.
This commit is contained in:
Mykyta Biliavskyi 2015-09-16 09:50:08 +00:00
parent e2cc943e77
commit ba45d8689e
1 changed files with 18 additions and 0 deletions

View File

@ -328,6 +328,24 @@ ctxpopup_candidate_dismiss_cb(void *data, Evas_Object *obj,
void *event_info EINA_UNUSED)
{
edit_data *ed = data;
int cur_pos = elm_entry_cursor_pos_get(ed->en_edit);
elm_entry_cursor_line_end_set(ed->en_edit);
int end_pos = elm_entry_cursor_pos_get(ed->en_edit);
int i = 0;
char *ch;
for (i = cur_pos; i <= end_pos; i++)
{
elm_entry_cursor_pos_set(ed->en_edit, i);
ch = elm_entry_cursor_content_get(ed->en_edit);
if (*ch == ';')
{
elm_entry_cursor_pos_set(ed->en_edit, i + 1);
break;
}
}
evas_object_del(obj);
elm_object_tree_focus_allow_set(ed->layout, EINA_TRUE);
elm_object_focus_set(ed->en_edit, EINA_TRUE);