diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_text/space_text.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index bd85551f8b1..a0659d5ce62 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -472,13 +472,26 @@ static void text_drop_copy(wmDrag *drag, wmDropBox *drop) RNA_string_set(drop->ptr, "filepath", drag->path); } +static int text_drop_paste_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) +{ + if (drag->type == WM_DRAG_ID) + return TRUE; + + return FALSE; +} + +static void text_drop_paste(wmDrag *drag, wmDropBox *drop) +{ + RNA_string_set(drop->ptr, "text", ((ID*)drag->poin)->name + 2); +} + /* this region dropbox definition */ static void text_dropboxes(void) { ListBase *lb = WM_dropboxmap_find("Text", SPACE_TEXT, RGN_TYPE_WINDOW); WM_dropbox_add(lb, "TEXT_OT_open", text_drop_poll, text_drop_copy); - + WM_dropbox_add(lb, "TEXT_OT_insert", text_drop_paste_poll, text_drop_paste); } /* ************* end drop *********** */ |