summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiep Ha <thiepha@gmail.com>2015-06-16 14:41:55 +0100
committerTom Hacohen <tom@stosb.com>2015-06-16 14:41:55 +0100
commit23c1cc758ea1b6dde2a66e1f44856af9204820ea (patch)
tree7aa364b489cc0ab6ea5143dedd2327ab1001cb10
parentaa7f859da10ce007a7b945a8703e70161c96146d (diff)
entry: emit changed,user signal when text is pasted or dropped
Summary: When text is pasted or dropped into entry, the "changed,user" signal should be emitted, not "changed" signal. Currently, the "changed" signal is emitted. This patch fixes this issue. @fix Reviewers: herdsman, tasn Subscribers: tasn Differential Revision: https://phab.enlightenment.org/D2710
-rw-r--r--src/lib/elm_entry.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c
index 3eb4c1121..6b8002b74 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -631,6 +631,17 @@ _elm_entry_theme_group_get(Evas_Object *obj)
631 } 631 }
632} 632}
633 633
634static void
635_edje_entry_user_insert(Evas_Object *obj, const char *data)
636{
637 if (!data) return;
638 ELM_ENTRY_DATA_GET(obj, sd);
639
640 sd->changed = EINA_TRUE;
641 edje_object_part_text_user_insert(sd->entry_edje, "elm.text", data);
642 elm_layout_sizing_eval(obj);
643}
644
634static Eina_Bool 645static Eina_Bool
635_selection_data_cb(void *data EINA_UNUSED, 646_selection_data_cb(void *data EINA_UNUSED,
636 Evas_Object *obj, 647 Evas_Object *obj,
@@ -661,14 +672,14 @@ _selection_data_cb(void *data EINA_UNUSED,
661 len = strlen(tag_string) + strlen(buf); 672 len = strlen(tag_string) + strlen(buf);
662 entry_tag = alloca(len + 1); 673 entry_tag = alloca(len + 1);
663 snprintf(entry_tag, len + 1, tag_string, buf); 674 snprintf(entry_tag, len + 1, tag_string, buf);
664 elm_entry_entry_insert(obj, entry_tag); 675 _edje_entry_user_insert(obj, entry_tag);
665 } 676 }
666 else 677 else
667 { 678 {
668 char *txt = _elm_util_text_to_mkup(buf); 679 char *txt = _elm_util_text_to_mkup(buf);
669 if (txt) 680 if (txt)
670 { 681 {
671 elm_entry_entry_insert(obj, txt); 682 _edje_entry_user_insert(obj, txt);
672 free(txt); 683 free(txt);
673 } 684 }
674 else 685 else
@@ -1373,7 +1384,7 @@ _elm_entry_entry_paste(Evas_Object *obj,
1373 str = strdup(entry); 1384 str = strdup(entry);
1374 if (!str) str = (char *)entry; 1385 if (!str) str = (char *)entry;
1375 1386
1376 edje_object_part_text_user_insert(sd->entry_edje, "elm.text", str); 1387 _edje_entry_user_insert(obj, str);
1377 1388
1378 if (str != entry) free(str); 1389 if (str != entry) free(str);
1379} 1390}
@@ -1436,8 +1447,7 @@ _cut_cb(void *data,
1436 elm_widget_scroll_hold_pop(data); 1447 elm_widget_scroll_hold_pop(data);
1437 1448
1438 _selection_store(ELM_SEL_TYPE_CLIPBOARD, data); 1449 _selection_store(ELM_SEL_TYPE_CLIPBOARD, data);
1439 edje_object_part_text_user_insert(sd->entry_edje, "elm.text", ""); 1450 _edje_entry_user_insert(data, "");
1440 elm_layout_sizing_eval(data);
1441} 1451}
1442 1452
1443static void 1453static void