[pitivi] Set zoomed_fitted to False on scroll events. scrollToPosition when not zoomed_fitted.
- From: Jean-François Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] Set zoomed_fitted to False on scroll events. scrollToPosition when not zoomed_fitted.
- Date: Wed, 24 Apr 2013 18:05:22 +0000 (UTC)
commit 7568c9c0b04fa192ff8132647f8c0e9c637f801f
Author: Mathieu Duponchelle <mathieu duponchelle epitech eu>
Date: Mon Apr 22 18:28:43 2013 +0200
Set zoomed_fitted to False on scroll events. scrollToPosition when not zoomed_fitted.
pitivi/timeline/timeline.py | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index da0fae6..0372a95 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -578,6 +578,8 @@ class Timeline(Gtk.VBox, Zoomable):
self.bTimeline.enable_update(True)
if self.zoomed_fitted:
self._setBestZoomRatio()
+ else:
+ self.scrollToPosition(self.bTimeline.props.duration)
def setProjectManager(self, projectmanager):
if self._projectmanager is not None:
@@ -1091,15 +1093,11 @@ class Timeline(Gtk.VBox, Zoomable):
self.setTimeline(project.timeline)
def _zoomInCb(self, unused_action):
- # This only handles the button callbacks (from the menus),
- # not keyboard shortcuts or the zoom slider!
Zoomable.zoomIn()
self.log("Setting 'zoomed_fitted' to False")
self.zoomed_fitted = False
def _zoomOutCb(self, unused_action):
- # This only handles the button callbacks (from the menus),
- # not keyboard shortcuts or the zoom slider!
Zoomable.zoomOut()
self.log("Setting 'zoomed_fitted' to False")
self.zoomed_fitted = False
@@ -1138,6 +1136,7 @@ class Timeline(Gtk.VBox, Zoomable):
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:
@@ -1192,6 +1191,9 @@ class Timeline(Gtk.VBox, Zoomable):
self.timeline.resetGhostClips()
if self.zoomed_fitted:
self._setBestZoomRatio()
+ else:
+ x, y = self._transposeXY(x, y)
+ self.scrollToPosition(Zoomable.pixelToNs(x))
else:
actor = self.stage.get_actor_at_pos(Clutter.PickMode.ALL, x, y)
try:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]