edc_editor: Prevent auto-scrolling by scroller

Summary:
scroller had auto-scroll properties.
In detail, when the content of scroller have focus, the scroller scroll top-left
position of the content.

But enventor does not want to auto-scroll.
This prevent it.

Ref : 44e40c7c5e4549e78008eb7b74b6ab1b7e1fcf9d

Test Plan:
1. Open enventor basic template
2. Scroll down
3. click edc_editor

Reviewers: Jaehyun_Cho, cedric

Reviewed By: cedric

Subscribers: jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D4930
This commit is contained in:
YeongJong Lee 2017-07-10 20:33:34 +09:00 committed by Jaehyun Cho
parent 8b55d776da
commit b13596ac2c
1 changed files with 13 additions and 2 deletions

View File

@ -1152,11 +1152,20 @@ err:
}
static void
edit_focused_cb(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
edit_focused_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
edit_data *ed = data;
evas_object_smart_callback_call(ed->enventor, SIG_FOCUSED, NULL);
//Prevent auto-scrolling by scroller
elm_object_focus_allow_set(obj, EINA_FALSE);
}
static void
edit_unfocused_cb(void *data EINA_UNUSED, Evas_Object *obj,
void *event_info EINA_UNUSED)
{
elm_object_focus_allow_set(obj, EINA_TRUE);
}
/*****************************************************************************/
@ -1513,6 +1522,8 @@ edit_init(Enventor_Object *enventor, Enventor_Item *it)
elm_entry_context_menu_disabled_set(en_edit, EINA_TRUE);
elm_entry_line_wrap_set(en_edit, ELM_WRAP_NONE);
evas_object_smart_callback_add(en_edit, "focused", edit_focused_cb, ed);
evas_object_smart_callback_add(en_edit, "unfocused",
edit_unfocused_cb, NULL);
evas_object_smart_callback_add(en_edit, "changed,user", edit_changed_cb, ed);
evas_object_smart_callback_add(en_edit, "cursor,changed",
edit_cursor_changed_cb, ed);