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()
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()
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()
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
def _zoomInCb(self, unused_action): Zoomable.zoomIn() self.log("Setting 'zoomed_fitted' to False") self.zoomed_fitted = False