Skip to content

Commit 8a25c68

Browse files
committed
Modify JumpToStart to use the GetMinFrame() method, and have it scroll to the new playhead position. This will select the first clip on the timeline and jump the scrollbar to it. Also updated the JumpToEnd to scroll to the playhead position.
1 parent 0699779 commit 8a25c68

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/windows/main_window.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,13 +1119,18 @@ def actionJumpStart_trigger(self, checked=True):
11191119
player = self.preview_thread.player
11201120
current_speed = player.Speed()
11211121

1122+
min_frame = 1
1123+
if self.preview_thread and self.preview_thread.timeline:
1124+
min_frame = self.preview_thread.timeline.GetMinFrame()
1125+
11221126
# Switch speed back to forward (and then pause)
11231127
# This will allow video caching to start working in the forward direction
11241128
self.SpeedSignal.emit(1)
11251129
self.SpeedSignal.emit(0)
11261130

11271131
# Seek to the 1st frame
1128-
self.SeekSignal.emit(1)
1132+
self.SeekSignal.emit(min_frame)
1133+
QTimer.singleShot(50, self.actionCenterOnPlayhead_trigger)
11291134

11301135
# If playing, continue playing
11311136
if current_speed >= 0:
@@ -1140,6 +1145,7 @@ def actionJumpEnd_trigger(self, checked=True):
11401145
# Determine last frame (based on clips) & seek there
11411146
max_frame = get_app().window.timeline_sync.timeline.GetMaxFrame()
11421147
self.SeekSignal.emit(max_frame)
1148+
QTimer.singleShot(50, self.actionCenterOnPlayhead_trigger)
11431149

11441150
def onPlayCallback(self):
11451151
"""Handle when playback is started"""

0 commit comments

Comments
 (0)