Skip to content

Commit

Permalink
Clicking the ruler time (top left of the timeline ruler) now jumps to…
Browse files Browse the repository at this point in the history
… the beginning of the timeline (moves the playhead and scrolls)
  • Loading branch information
jonoomph committed Sep 17, 2024
1 parent ca35a9f commit 3ad246b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/timeline/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

<!-- RULER NAME (left of screen) -->
<div tl-rulertime id="ruler_label">
<div id="ruler_time">{{playheadTime.hour}}:{{playheadTime.min}}:{{playheadTime.sec}},{{playheadTime.frame}}</div>
<div id="ruler_time" ng-click="rulerTimeClick()">{{playheadTime.hour}}:{{playheadTime.min}}:{{playheadTime.sec}},{{playheadTime.frame}}</div>
</div>
<!-- RULER (right of screen) -->
<div id="scrolling_ruler">
Expand Down
14 changes: 14 additions & 0 deletions src/timeline/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,20 @@ App.controller("TimelineCtrl", function ($scope) {
return Math.max(min_value, $scope.project.duration * $scope.pixelsPerSecond);
};

// Seek to the beginning of the timeline
$scope.rulerTimeClick = function () {
$scope.movePlayhead(0.0);
$scope.previewFrame(0.0);

// Force a scroll event (from 1 to 0, to send the geometry to zoom slider)
$("#scrolling_tracks").scrollLeft(1);

// Scroll to top/left when loading a project
$("#scrolling_tracks").animate({
scrollTop: 0,
scrollLeft: 0
}, "slow");
};

// Get Position of item (used by Qt), both the position and track number.
/**
Expand Down

0 comments on commit 3ad246b

Please sign in to comment.