[ocrfeeder] Implement mousewheel horizontal scroll (bug 620212)



commit b3c509684924f4755861ac577232d792d64ef5b6
Author: Stefan Löffler <st loeffler gmail com>
Date:   Fri Jun 4 10:17:28 2010 +0200

    Implement mousewheel horizontal scroll (bug 620212)
    
    Hold down Shift while scrolling to switch from vertical to horizontal scroll mode

 studio/customWidgets.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/studio/customWidgets.py b/studio/customWidgets.py
index c8e0014..e99abd9 100644
--- a/studio/customWidgets.py
+++ b/studio/customWidgets.py
@@ -325,6 +325,14 @@ class SelectableBoxesArea(goocanvas.Canvas):
                  event.direction == gtk.gdk.SCROLL_LEFT:
                 self.zoom(-0.05)
                 return True # we have handled the event - don't propagate to parent
+        elif event.state & gtk.gdk.SHIFT_MASK:
+            event.state &= ~gtk.gdk.SHIFT_MASK
+            if event.direction == gtk.gdk.SCROLL_UP:
+                event.direction = gtk.gdk.SCROLL_LEFT
+                return False # we have not handled the (new) event - propagate to parent
+            elif event.direction == gtk.gdk.SCROLL_DOWN:
+                event.direction = gtk.gdk.SCROLL_RIGHT
+                return False # we have not handled the (new) event - propagate to parent
     
     def setAreaFillRgba(self, rgba):
         self.area_fill_rgba = rgba



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