[gthumb] Also use button 2 in gth-image-dragger



commit 1b606843278c30e6713dd54bcb781156e30c00f7
Author: Adrian Knoth <adi drcomp erfurt thur de>
Date:   Sun Apr 14 20:48:41 2013 +0200

    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>

 gthumb/gth-image-dragger.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
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;


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