Switch timeline from ScrollView to Flickable

parent 85c60be8
Pipeline #14181 passed with stage
in 15 minutes and 18 seconds
......@@ -72,7 +72,7 @@ Rectangle {
property bool isComposition: false
property bool hideClipViews: false
property var groupTrimData
property int scrollStart: scrollView.contentItem.contentX - (clipRoot.modelStart * timeline.scaleFactor)
property int scrollStart: scrollView.contentX - (clipRoot.modelStart * timeline.scaleFactor)
width : clipDuration * timeScale
opacity: dragProxyArea.drag.active && dragProxy.draggedItem == clipId ? 0.8 : 1.0
......
......@@ -62,7 +62,7 @@ Item {
property color color: displayRect.color
property color borderColor: 'black'
property bool hideCompoViews
property int scrollStart: scrollView.contentItem.contentX - modelStart * timeline.scaleFactor
property int scrollStart: scrollView.contentX - modelStart * timeline.scaleFactor
signal moved(var clip)
signal dragged(var clip, var mouse)
......
......@@ -101,7 +101,7 @@ Rectangle {
Repeater {
id: tickRepeater
model: scrollView.width / rulerRoot.tickSpacing + 2
property int offset: Math.floor(scrollView.contentItem.contentX /rulerRoot.tickSpacing)
property int offset: Math.floor(scrollView.contentX /rulerRoot.tickSpacing)
Item {
property int realPos: (tickRepeater.offset + index) * rulerRoot.tickSpacing / timeline.scaleFactor
x: realPos * timeline.scaleFactor
......
......@@ -19,12 +19,12 @@
function scrollIfNeeded() {
if (!scrollView) return;
var x = root.consumerPosition * timeline.scaleFactor;
if (x > scrollView.contentItem.contentX + scrollView.width - 50)
scrollView.contentItem.contentX = x - scrollView.width + 50;
if (x > scrollView.contentX + scrollView.width - 50)
scrollView.contentX = x - scrollView.width + 50;
else if (x < 50)
scrollView.contentItem.contentX = 0;
else if (x < scrollView.contentItem.contentX + 50)
scrollView.contentItem.contentX = x - 50;
scrollView.contentX = 0;
else if (x < scrollView.contentX + 50)
scrollView.contentX = x - 50;
}
function getTrackIndexFromPos(pos) {
......@@ -49,7 +49,7 @@ function getTrackIdFromPos(pos) {
}
function getTrackYFromId(id) {
var result = - scrollView.contentItem.contentY
var result = - scrollView.contentY
for (var i = 0; i < trackHeaderRepeater.count; i++) {
if (trackHeaderRepeater.itemAt(i).trackId == id) {
break;
......@@ -83,7 +83,7 @@ function getTrackYFromMltIndex(id) {
if (id <= 0) {
return 0
}
var result = - scrollView.contentItem.contentY
var result = - scrollView.contentY
for (var i = 0; i < trackHeaderRepeater.count - id; i++) {
result += trackHeaderRepeater.itemAt(i).height
}
......@@ -107,7 +107,7 @@ function getTracksList() {
}
function acceptDrop(xml) {
var position = Math.round((dropTarget.x + scrollView.contentItem.contentX - headerWidth) / timeline.scaleFactor)
var position = Math.round((dropTarget.x + scrollView.contentX - headerWidth) / timeline.scaleFactor)
timeline.insertClip(currentTrack, position, xml)
/*if (timeline.ripple)
timeline.insert(currentTrack, position, xml)
......
......@@ -94,7 +94,7 @@ Item{
Binding {
target: loader.item
property: "scrollX"
value: scrollView.contentItem.contentX
value: scrollView.contentX
when: loader.status == Loader.Ready && loader.item
}
Binding {
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment