Commit 86f309c9 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix update of timeline thumbs on clip change

parent 89c5d680
......@@ -97,7 +97,7 @@ Rectangle {
onInPointChanged: {
if (parentTrack.isAudio) {
thumbsLoader.item.generateWaveform()
thumbsLoader.item.reload()
}
}
......@@ -139,6 +139,7 @@ Rectangle {
onForceReloadThumbChanged: {
// TODO: find a way to force reload of clip thumbs
thumbsLoader.item.reload()
}
onTimeScaleChanged: {
......@@ -146,7 +147,7 @@ Rectangle {
width = clipDuration * timeScale;
labelRect.x = scrollX > modelStart * timeScale ? scrollX - modelStart * timeScale : 0
if (parentTrack.isAudio) {
thumbsLoader.item.generateWaveform();
thumbsLoader.item.reload();
}
}
onScrollXChanged: {
......@@ -218,7 +219,7 @@ Rectangle {
onAudioLevelsChanged: {
if (parentTrack.isAudio) {
thumbsLoader.item.generateWaveform()
thumbsLoader.item.reload()
}
}
MouseArea {
......
......@@ -14,7 +14,7 @@ Row {
property int scrollStart: Math.max(0, scrollView.flickableItem.contentX / timeline.scaleFactor - clipRoot.modelStart)
property int scrollEnd: scrollStart + scrollView.viewport.width / timeline.scaleFactor
function generateWaveform() {
function reload() {
// This is needed to make the model have the correct count.
// Model as a property expression is not working in all cases.
if (timeline.showAudioThumbnails) {
......
......@@ -12,6 +12,11 @@ Row {
property int thumbWidth: container.height * 16.0/9.0
property int scrollStart: Math.max(0, scrollView.flickableItem.contentX / timeline.scaleFactor - clipRoot.modelStart)
property int scrollEnd: scrollStart + scrollView.viewport.width / timeline.scaleFactor
function reload() {
clipRoot.baseThumbPath =''
clipRoot.baseThumbPath = clipRoot.variableThumbs ? '' : 'image://thumbnail/' + clipRoot.binId + '/' + (clipRoot.isImage ? '#0' : '#')
}
Repeater {
id: thumbRepeater
// switching the model allows to have different view modes:
......
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