Exemple #1
0
 def do_scroll_event(self, event):
     if event.scroll.state & Gdk.ModifierType.CONTROL_MASK:
         # Control + scroll = zoom
         if event.scroll.direction == Gdk.ScrollDirection.UP:
             Zoomable.zoomIn()
         elif event.scroll.direction == Gdk.ScrollDirection.DOWN:
             Zoomable.zoomOut()
     else:
         # No modifier key held down, just scroll
         if event.scroll.direction in (Gdk.ScrollDirection.UP,
                                       Gdk.ScrollDirection.LEFT):
             self.timeline.scroll_left()
         elif event.scroll.direction in (Gdk.ScrollDirection.DOWN,
                                         Gdk.ScrollDirection.RIGHT):
             self.timeline.scroll_right()
Exemple #2
0
 def do_scroll_event(self, event):
     if event.scroll.state & Gdk.ModifierType.CONTROL_MASK:
         # Control + scroll = zoom
         if event.scroll.direction == Gdk.ScrollDirection.UP:
             Zoomable.zoomIn()
             self.app.gui.timeline_ui.zoomed_fitted = False
         elif event.scroll.direction == Gdk.ScrollDirection.DOWN:
             Zoomable.zoomOut()
             self.app.gui.timeline_ui.zoomed_fitted = False
     else:
         # No modifier key held down, just scroll
         if (event.scroll.direction == Gdk.ScrollDirection.UP
         or event.scroll.direction == Gdk.ScrollDirection.LEFT):
             self.app.gui.timeline_ui.scroll_left()
         elif (event.scroll.direction == Gdk.ScrollDirection.DOWN
         or event.scroll.direction == Gdk.ScrollDirection.RIGHT):
             self.app.gui.timeline_ui.scroll_right()
Exemple #3
0
 def do_scroll_event(self, event):
     if event.state & gtk.gdk.CONTROL_MASK:
         # Control + scroll = zoom
         if event.direction == gtk.gdk.SCROLL_UP:
             Zoomable.zoomIn()
             self.app.gui.timeline_ui.zoomed_fitted = False
         elif event.direction == gtk.gdk.SCROLL_DOWN:
             Zoomable.zoomOut()
             self.app.gui.timeline_ui.zoomed_fitted = False
     else:
         # No modifier key held down, just scroll
         if event.direction == gtk.gdk.SCROLL_UP or\
             event.direction == gtk.gdk.SCROLL_LEFT:
             self.app.gui.timeline_ui.scroll_left()
         elif event.direction == gtk.gdk.SCROLL_DOWN or\
             event.direction == gtk.gdk.SCROLL_RIGHT:
             self.app.gui.timeline_ui.scroll_right()
Exemple #4
0
 def _scrollEventCb(self, embed, event):
     # FIXME : see https://bugzilla.gnome.org/show_bug.cgi?id=697522
     deltas = event.get_scroll_deltas()
     if event.state & Gdk.ModifierType.CONTROL_MASK:
         if deltas[2] < 0:
             Zoomable.zoomIn()
         elif deltas[2] > 0:
             Zoomable.zoomOut()
         self.zoomed_fitted = False
         self._scrollToPlayhead()
     elif event.state & Gdk.ModifierType.SHIFT_MASK:
         if deltas[2] > 0:
             self._scrollDown()
         elif deltas[2] < 0:
             self._scrollUp()
     else:
         if deltas[2] > 0:
             self._scrollRight()
         elif deltas[2] < 0:
             self._scrollLeft()
     self.scrolled += 1
Exemple #5
0
 def _zoomOutCb(self, unused_action):
     Zoomable.zoomOut()
     self.log("Setting 'zoomed_fitted' to False")
     self.zoomed_fitted = False