[gthumb-list] [PATCH 1/1] Also use button 2 in gth-image-dragger



GIMP and inkscape both allow to drag the image around while holding down
button2 (mouse wheel).

For the sake of convenience (users who are familiar with those other
tools), implement the same in gthumb.

Button1 is not changed, so button1 and button2 now both allow to drag
the image.

Signed-off-by: Adrian Knoth <adi drcomp erfurt thur de>

diff --git a/gthumb/gth-image-dragger.c b/gthumb/gth-image-dragger.c
index 79976da..3201e58 100644
--- a/gthumb/gth-image-dragger.c
+++ b/gthumb/gth-image-dragger.c
@@ -216,7 +216,8 @@ gth_image_dragger_button_press (GthImageViewerTool *self,
        if (! dragger->priv->draggable)
                return FALSE;
 
-       if ((event->button == 1) && ! viewer->dragging) {
+       if (((event->button == 1) || (event->button == 2)) &&
+                       ! viewer->dragging) {
                GdkCursor     *cursor;
                GdkGrabStatus  retval;
 
@@ -254,7 +255,7 @@ gth_image_dragger_button_release (GthImageViewerTool *self,
        GthImageDragger *dragger;
        GthImageViewer  *viewer;
 
-       if (event->button != 1)
+       if ((event->button != 1) && (event->button != 2))
                return FALSE;
 
        dragger = (GthImageDragger *) self;
-- 
1.7.10.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]