File tree 3 files changed +28
-1
lines changed
3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ App.controller("TimelineCtrl", function ($scope) {
69
69
$scope . track_label = "Track %s" ;
70
70
$scope . enable_sorting = true ;
71
71
$scope . ThumbServer = "http://127.0.0.1/" ;
72
+ $scope . ignore_scroll = false ;
72
73
73
74
// Method to set if Qt is detected (which clears demo data
74
75
// and updates the document_is_ready variable in openshot-qt)
@@ -285,13 +286,19 @@ App.controller("TimelineCtrl", function ($scope) {
285
286
var scrolling_tracks = $ ( "#scrolling_tracks" ) ;
286
287
var horz_scroll_offset = normalizedScrollValue * timeline_length ;
287
288
scrolling_tracks . scrollLeft ( horz_scroll_offset ) ;
289
+
290
+ $scope . ignore_scroll = true ;
291
+ $ ( "#scrolling_ruler" ) . scrollLeft ( horz_scroll_offset ) ;
288
292
} ;
289
293
290
- // Scroll the timeline horizontally of a certain amount (scrol_value)
294
+ // Scroll the timeline horizontally of a certain amount
291
295
$scope . scrollLeft = function ( scroll_value ) {
292
296
var scrolling_tracks = $ ( "#scrolling_tracks" ) ;
293
297
var horz_scroll_offset = scrolling_tracks . scrollLeft ( ) ;
294
298
scrolling_tracks . scrollLeft ( horz_scroll_offset + scroll_value ) ;
299
+
300
+ $scope . ignore_scroll = true ;
301
+ $ ( "#scrolling_ruler" ) . scrollLeft ( horz_scroll_offset + scroll_value ) ;
295
302
} ;
296
303
297
304
// Center the timeline on a given time position
Original file line number Diff line number Diff line change @@ -54,6 +54,22 @@ App.directive("tlScrollableTracks", function () {
54
54
$ ( "#scrolling_ruler" ) . scrollLeft ( element . scrollLeft ( ) ) ;
55
55
$ ( "#progress_container" ) . scrollLeft ( element . scrollLeft ( ) ) ;
56
56
57
+ if ( scope . ignore_scroll == true ) {
58
+ // Reset flag and ignore scroll propagation
59
+ scope . $apply ( ( ) => {
60
+ scope . ignore_scroll = false ;
61
+ scope . scrollLeft = element [ 0 ] . scrollLeft ;
62
+ } )
63
+ // exit at this point
64
+ return ;
65
+
66
+ } else {
67
+ // Only update scroll position
68
+ scope . $apply ( ( ) => {
69
+ scope . scrollLeft = element [ 0 ] . scrollLeft ;
70
+ } )
71
+ }
72
+
57
73
// Send scrollbar position to Qt
58
74
if ( scope . Qt ) {
59
75
// Calculate scrollbar positions (left and right edge of scrollbar)
Original file line number Diff line number Diff line change @@ -2750,6 +2750,10 @@ def update_scroll(self, newScroll):
2750
2750
# Get access to timeline scope and set scale to new computed value
2751
2751
self .run_js (JS_SCOPE_SELECTOR + ".setScroll(" + str (newScroll ) + ");" )
2752
2752
2753
+ # This seems to make web-engine zoom slider scroll events go smoother
2754
+ # TODO: remove this if we can find a better approach.
2755
+ QCoreApplication .processEvents ()
2756
+
2753
2757
# Handle changes to zoom level, update js
2754
2758
def update_zoom (self , newScale ):
2755
2759
_ = get_app ()._tr
You can’t perform that action at this time.
0 commit comments