[pitivi] Set easing duration while scrolling.
- From: Jean-François Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] Set easing duration while scrolling.
- Date: Wed, 24 Apr 2013 18:04:47 +0000 (UTC)
commit f215037d34480025715e1754e71fc54e68888c93
Author: Mathieu Duponchelle <mathieu duponchelle epitech eu>
Date: Sun Apr 21 23:28:22 2013 +0200
Set easing duration while scrolling.
pitivi/timeline/timeline.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 1975f63..ae31768 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -305,9 +305,12 @@ class TimelineStage(Clutter.ScrollActor, Zoomable):
self.lastPosition = position
def _updatePlayHead(self):
+ self.playhead.save_easing_state()
+ self.playhead.set_easing_duration(600)
height = len(self.bTimeline.get_layers()) * (EXPANDED_SIZE + SPACING) * 2
self.playhead.set_size(PLAYHEAD_WIDTH, height)
self.playhead.props.x = self.nsToPixel(self.lastPosition)
+ self.playhead.restore_easing_state()
def _createPlayhead(self):
self.playhead = Clutter.Actor()
@@ -863,7 +866,10 @@ class Timeline(Gtk.VBox, Zoomable):
self.vadj.props.page_size ** (2.0 / 3.0))
def _scrollToPosition(self, position):
+ self.timeline.save_easing_state()
+ self.timeline.set_easing_duration(600)
self._hscrollBar.set_value(position)
+ self.timeline.restore_easing_state()
return False
def _scrollToPlayhead(self):
@@ -871,7 +877,7 @@ class Timeline(Gtk.VBox, Zoomable):
if self.ruler.pressed or self.pressed:
return
canvas_size = self.embed.get_allocation().width - CONTROL_WIDTH
- new_pos = self.timeline.playhead.props.x
+ new_pos = Zoomable.nsToPixel(self.app.current.pipeline.getPosition())
scroll_pos = self.hadj.get_value()
self.scrollToPosition(min(new_pos - canvas_size / 2,
self.hadj.props.upper - canvas_size - 1))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]