aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/image-inline/image-inline.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-02-11 20:30:10 +0800
committerMilan Crha <mcrha@redhat.com>2010-02-11 20:31:26 +0800
commit4dbd42ed5001401cb79917b6f49be0af81ccc28d (patch)
tree4cfb25ea7745c4dbd3cd6b3454bb319819fa1421 /plugins/image-inline/image-inline.c
parent968de42d1e8565fc84aabaec93aea4819eb83e77 (diff)
downloadgsoc2013-evolution-4dbd42ed5001401cb79917b6f49be0af81ccc28d.tar.gz
gsoc2013-evolution-4dbd42ed5001401cb79917b6f49be0af81ccc28d.tar.zst
gsoc2013-evolution-4dbd42ed5001401cb79917b6f49be0af81ccc28d.zip
Bug #604522 - Mouse wheel scroll doesn't work above inline images
Diffstat (limited to 'plugins/image-inline/image-inline.c')
-rw-r--r--plugins/image-inline/image-inline.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/image-inline/image-inline.c b/plugins/image-inline/image-inline.c
index fdff39a921..12568eecca 100644
--- a/plugins/image-inline/image-inline.c
+++ b/plugins/image-inline/image-inline.c
@@ -259,6 +259,24 @@ size_allocate_cb (GtkHTMLEmbedded *embedded,
}
static void
+mouse_wheel_scroll_cb (GtkWidget *img_view, GdkScrollDirection direction, ImageInlinePObject *image_object)
+{
+ GtkHTML *html;
+ gint steps = 2;
+
+ g_return_if_fail (image_object != NULL);
+ g_return_if_fail (image_object->object.format != NULL);
+ g_return_if_fail (image_object->object.format->html != NULL);
+
+ html = image_object->object.format->html;
+
+ while (steps > 0) {
+ g_signal_emit_by_name (html, "scroll", (direction == GDK_SCROLL_DOWN || direction == GDK_SCROLL_UP) ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL, (direction == GDK_SCROLL_DOWN || direction == GDK_SCROLL_RIGHT) ? GTK_SCROLL_STEP_FORWARD : GTK_SCROLL_STEP_BACKWARD, 2.0, NULL);
+ steps--;
+ }
+}
+
+static void
org_gnome_image_inline_pobject_free (EMFormatHTMLPObject *object)
{
ImageInlinePObject *image_object;
@@ -284,6 +302,9 @@ org_gnome_image_inline_pobject_free (EMFormatHTMLPObject *object)
g_signal_handlers_disconnect_by_func (
image_object->widget,
drag_data_get_cb, image_object);
+ g_signal_handlers_disconnect_by_func (
+ image_object->widget,
+ mouse_wheel_scroll_cb, image_object);
parent = gtk_widget_get_parent (image_object->widget);
if (parent != NULL)
@@ -388,6 +409,10 @@ org_gnome_image_inline_embed (EMFormatHTML *format,
embedded, "size-allocate",
G_CALLBACK (size_allocate_cb), image_object);
+ g_signal_connect (
+ image_view, "mouse-wheel-scroll",
+ G_CALLBACK (mouse_wheel_scroll_cb), image_object);
+
return TRUE;
}