diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-02-03 11:48:43 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-02-03 11:48:43 +0800 |
commit | 93a51af22567bdddf3978716791f0be2e1dd2656 (patch) | |
tree | 80984c2c3a564bca5ba1ab95497dd80b3fd81f9c /composer/e-msg-composer.c | |
parent | c49e3012a029bb78dc759a9fc8dfc1103a36d976 (diff) | |
download | gsoc2013-evolution-93a51af22567bdddf3978716791f0be2e1dd2656.tar.gz gsoc2013-evolution-93a51af22567bdddf3978716791f0be2e1dd2656.tar.zst gsoc2013-evolution-93a51af22567bdddf3978716791f0be2e1dd2656.zip |
Fix image dropping in composer while in HTML mode.
Dragging image data or an image URI to the message body while in HTML
mode should insert the image inline, not attach it. Without this the
Picture Gallery feature is pointless.
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r-- | composer/e-msg-composer.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 7439007ae4..d3df63aad0 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1830,6 +1830,21 @@ msg_composer_drag_data_received_cb (GtkWidget *widget, { EAttachmentView *view; + /* HTML mode has a few special cases for drops... */ + if (gtkhtml_editor_get_html_mode (GTKHTML_EDITOR (composer))) { + + /* If we're receiving an image, we want the image to be + * inserted in the message body. Let GtkHtml handle it. */ + if (gtk_selection_data_targets_include_image (selection, TRUE)) + return; + + /* If we're receiving URIs and -all- the URIs point to + * image files, we want the image(s) to be inserted in + * the message body. Let GtkHtml handle it. */ + if (e_composer_selection_is_image_uris (composer, selection)) + return; + } + view = e_msg_composer_get_attachment_view (composer); /* Forward the data to the attachment view. Note that calling |