diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-02-03 11:48:43 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:31 +0800 |
commit | f099f679dcdd568cb5b7c8838f5f114ed19bce07 (patch) | |
tree | d54fa9561ef243e4ba8ce57d1e6a885406af02c6 /composer/e-msg-composer.c | |
parent | d92cfbebd8d52cfeeb3133ab30f0e1c56ce41ed5 (diff) | |
download | gsoc2013-evolution-f099f679dcdd568cb5b7c8838f5f114ed19bce07.tar.gz gsoc2013-evolution-f099f679dcdd568cb5b7c8838f5f114ed19bce07.tar.zst gsoc2013-evolution-f099f679dcdd568cb5b7c8838f5f114ed19bce07.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 |