Revert "Revert "entry: disable text selection by user interaction if elm_entry_select... 24/164624/1 accepted/tizen/4.0/unified/20171221.070856 submit/tizen_4.0/20171220.063404
authorYoungbok Shin <youngb.shin@samsung.com>
Wed, 20 Dec 2017 05:06:40 +0000 (05:06 +0000)
committerYoungbok Shin <youngb.shin@samsung.com>
Wed, 20 Dec 2017 05:06:40 +0000 (05:06 +0000)
This reverts commit ef9dc3b049a2c7511b37fffb62146d982555a19b.

Change-Id: I4079041ae846223b16db40a980fb9ac591c7aa08

src/lib/elm_entry.c
src/modules/copypasteUI_ctxpopup/copypaste.c

index d70db1b..aad5e0a 100644 (file)
@@ -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);
    //
index d3696ee..821b8ea 100644 (file)
@@ -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)
                          {