summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiep Ha <thiepha@gmail.com>2015-04-30 14:43:59 +0900
committerThiep Ha <thiepha@gmail.com>2015-06-02 21:50:24 +0900
commit9508eac0cd0bc5326e5f9f44494ebdd2ddf738a3 (patch)
tree365955d571ff979e235b3b2746cb5ab1870691e0
parent7a119ad957e8adb1a715fd024169039cd80119a8 (diff)
DnD/Wl: Entry should handle image drop
When image is dropped into entry, we should insert image to the entry. This patch checks drop format and inserts image to entry if needed. Test case: Run elementary_test with wayland, Types Dnd, drag image and drop it to right entry.
-rw-r--r--src/lib/elm_entry.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c
index 5ab7fd1c7..e810afd1c 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -654,7 +654,24 @@ _drag_drop_cb(void *data EINA_UNUSED,
654 } 654 }
655 memcpy(buf, drop->data, drop->len); 655 memcpy(buf, drop->data, drop->len);
656 buf[drop->len] = '\0'; 656 buf[drop->len] = '\0';
657 elm_entry_entry_insert(obj, buf); 657
658 if (drop->format & ELM_SEL_FORMAT_IMAGE)
659 {
660 char *entry_tag;
661 int len;
662 static const char *tag_string =
663 "<item absize=240x180 href=file://%s></item>";
664
665 len = strlen(tag_string) + strlen(buf);
666 entry_tag = alloca(len + 1);
667 snprintf(entry_tag, len + 1, tag_string, buf);
668 elm_entry_entry_insert(obj, entry_tag);
669 }
670 else
671 {
672 elm_entry_entry_insert(obj, buf);
673 }
674
658 free(buf); 675 free(buf);
659 edje_object_part_text_cursor_copy 676 edje_object_part_text_cursor_copy
660 (sd->entry_edje, "elm.text", EDJE_CURSOR_USER, /*->*/ EDJE_CURSOR_MAIN); 677 (sd->entry_edje, "elm.text", EDJE_CURSOR_USER, /*->*/ EDJE_CURSOR_MAIN);