From a11b7e7b5eb67b701b72d1354afef9c32cc4bb0d Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Wed, 13 Dec 2017 19:29:47 +0900 Subject: [PATCH] entry: disable text selection by user interaction if elm_entry_select_allow_set() is called with EINA_FALSE @tizen_fix Change-Id: I86a2bc892f8de66c3d59b270f6146f03ac225506 --- src/lib/elm_entry.c | 16 ++++++++++++++-- src/modules/copypasteUI_ctxpopup/copypaste.c | 6 +++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index d70db1b..aad5e0a 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -627,6 +627,10 @@ _select_all(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUS { ELM_ENTRY_DATA_GET(data, sd); + /* TIZEN_ONLY(20171213): disable text selection by user interaction if elm_entry_select_allow_set() is called with EINA_FALSE */ + if (!sd->sel_allow) return; + /* END */ + sd->sel_mode = EINA_TRUE; if (edje_object_part_text_selection_get(sd->entry_edje, "elm.text") == NULL) @@ -726,6 +730,10 @@ _select_word(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i Evas_Textblock_Cursor *cur = NULL; int pos = 0; + /* TIZEN_ONLY(20171213): disable text selection by user interaction if elm_entry_select_allow_set() is called with EINA_FALSE */ + if (!sd->sel_allow) return; + /* END */ + sd->sel_mode = EINA_TRUE; _adjust_eol_cursor(data); @@ -2456,7 +2464,11 @@ _hover_dismissed_cb(void *data, if (sd->hoversel) evas_object_hide(sd->hoversel); if (sd->sel_mode) { + /* TIZEN_ONLY(20171213): disable text selection by user interaction if elm_entry_select_allow_set() is called with EINA_FALSE if (!_elm_config->desktop_entry) + */ + if (sd->sel_allow && !_elm_config->desktop_entry) + /* END */ { if (!sd->password) edje_object_part_text_select_allow_set @@ -4816,7 +4828,7 @@ _start_handler_mouse_down_cb(void *data, // TIZEN ONLY (20150205): Support CopyPasteUI if ((sd->api) && (sd->api->obj_hidemenu)) sd->api->obj_hidemenu(data); - if (!_elm_config->desktop_entry) + if (sd->sel_allow && !_elm_config->desktop_entry) edje_object_part_text_select_allow_set(sd->entry_edje, "elm.text", EINA_TRUE); // @@ -5024,7 +5036,7 @@ _end_handler_mouse_down_cb(void *data, // TIZEN ONLY (20150205): Support CopyPasteUI if ((sd->api) && (sd->api->obj_hidemenu)) sd->api->obj_hidemenu(data); - if (!_elm_config->desktop_entry) + if (sd->sel_allow && !_elm_config->desktop_entry) edje_object_part_text_select_allow_set(sd->entry_edje, "elm.text", EINA_TRUE); // diff --git a/src/modules/copypasteUI_ctxpopup/copypaste.c b/src/modules/copypasteUI_ctxpopup/copypaste.c index d3696ee..821b8ea 100644 --- a/src/modules/copypasteUI_ctxpopup/copypaste.c +++ b/src/modules/copypasteUI_ctxpopup/copypaste.c @@ -1332,7 +1332,7 @@ obj_longpress(Evas_Object *obj) if (!ext_mod->selmode && !ext_mod->have_selection) { - if (!elm_entry_is_empty(obj)) + if (!elm_entry_is_empty(obj) && elm_entry_select_allow_get(obj)) { if (!ext_mod->password) { @@ -1450,7 +1450,7 @@ obj_longpress(Evas_Object *obj) { Eina_Bool selected_all = EINA_TRUE; ext_mod->is_selected_all(&selected_all, obj, NULL); - if (selected_all == EINA_FALSE) + if ((selected_all == EINA_FALSE) && elm_entry_select_allow_get(obj)) { CP_ICON_ADD(icon, "select_all"); if (ext_mod->profile_wear) @@ -1546,7 +1546,7 @@ obj_longpress(Evas_Object *obj) else { _cancel(obj,ext_mod->popup,NULL); - if (!elm_entry_is_empty(obj)) + if (!elm_entry_is_empty(obj) && elm_entry_select_allow_get(obj)) { if (!ext_mod->password) { -- 2.7.4