From 705f08c5c274a103115245e05f953694fc1f02ec 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 - /* multi-line */ comments - Single point of exit for a function --- src/main_window.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main_window.c b/src/main_window.c index 7dd02ba..3d3879b 100644 --- a/src/main_window.c +++ b/src/main_window.c @@ -2391,21 +2391,29 @@ 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))) + gboolean ret = FALSE; + + /* + * - 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; + ret = TRUE; /* don't call other callbacks */ case GDK_SCROLL_DOWN: case GDK_SCROLL_RIGHT: rstto_image_list_iter_next (window->priv->iter); - break; + ret = TRUE; } } - return FALSE; + return ret; } static gboolean -- 1.7.11.5