From 961f397d74acaae3b238bd71a147344b263dd05b Mon Sep 17 00:00:00 2001 From: Andrew Ash Date: Fri, 3 Aug 2012 01:15:09 -0700 Subject: [PATCH] Support shift+scroll to pan across an image --- src/main_window.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main_window.c b/src/main_window.c index df4d8e4..76a8469 100644 --- a/src/main_window.c +++ b/src/main_window.c @@ -2356,18 +2356,22 @@ cb_rstto_main_window_image_viewer_scroll_event (GtkWidget *widget, gpointer user_data) { RsttoMainWindow *window = RSTTO_MAIN_WINDOW (user_data); - if (!(event->state & (GDK_CONTROL_MASK))) + // scroll through images with scroll + // pan across current image with shift+scroll + // zoom on current image with ctrl+scroll + if (!(event->state & (GDK_CONTROL_MASK)) && + !(event->state & (GDK_SHIFT_MASK))) { switch(event->direction) { case GDK_SCROLL_UP: case GDK_SCROLL_LEFT: rstto_image_list_iter_previous (window->priv->iter); - break; + return TRUE; // don't call other callbacks case GDK_SCROLL_DOWN: case GDK_SCROLL_RIGHT: rstto_image_list_iter_next (window->priv->iter); - break; + return TRUE; } } return FALSE; -- 1.7.11.4