Fix broken timeline header position in some cases

parent 2e0fbcd8
Pipeline #15745 passed with stage
in 16 minutes and 16 seconds
......@@ -38,10 +38,8 @@ Rectangle {
property int iconSize: buttonSize - 4
property string trackTag
property int thumbsFormat: 0
property int collapsedHeight: buttonSize
border.width: 1
border.color: root.frameColor
signal clicked()
function pulseLockButton() {
flashLock.restart();
......@@ -82,7 +80,7 @@ Rectangle {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
onPressed: {
parent.clicked()
timeline.activeTrack = trackId
if (mouse.button == Qt.RightButton) {
root.showHeaderMenu()
}
......@@ -197,7 +195,7 @@ Rectangle {
//icon.height: trackHeadRoot.iconSize
icon.name: trackHeadRoot.collapsed ? 'arrow-right' : 'arrow-down'
onClicked: {
trackHeadRoot.myTrackHeight = trackHeadRoot.collapsed ? Math.max(collapsedHeight * 1.5, controller.getTrackProperty(trackId, "kdenlive:trackheight")) : collapsedHeight
trackHeadRoot.myTrackHeight = trackHeadRoot.collapsed ? Math.max(root.collapsedHeight * 1.5, controller.getTrackProperty(trackId, "kdenlive:trackheight")) : root.collapsedHeight
}
ToolTip {
visible: expandButton.hovered
......@@ -419,7 +417,7 @@ Rectangle {
}
onClicked: {
timeline.showTrackAsset(trackId)
trackHeadRoot.clicked()
timeline.activeTrack = trackId
trackHeadRoot.focus = true
}
onEntered: {
......@@ -497,7 +495,7 @@ Rectangle {
cursorShape: Qt.SizeVerCursor
drag.target: parent
drag.axis: Drag.YAxis
drag.minimumY: trackHeadRoot.collapsedHeight - resizer.height
drag.minimumY: root.collapsedHeight - resizer.height
property double startY
property double originalY
drag.smoothed: false
......@@ -522,7 +520,7 @@ Rectangle {
if (mouse.buttons === Qt.LeftButton) {
parent.opacity = 0.5
var newHeight = originalY + (mapToItem(null, x, y).y - startY)
newHeight = Math.max(trackHeadRoot.collapsedHeight, newHeight)
newHeight = Math.max(root.collapsedHeight, newHeight)
trackHeadRoot.myTrackHeight = newHeight
}
}
......
......@@ -265,6 +265,7 @@ Rectangle {
property int scrollMin: scrollView.contentX / timeline.scaleFactor
property int scrollMax: scrollMin + scrollView.contentItem.width / timeline.scaleFactor
property double dar: 16/9
property int collapsedHeight: baseUnit * 1.8
onSeekingFinishedChanged : {
playhead.opacity = seekingFinished ? 1 : 0.5
......@@ -296,7 +297,10 @@ Rectangle {
if (tk.y < scrollView.contentY) {
scrollView.contentY = Math.max(0, tk.y - scrollView.height / 3)
} else if (tk.y + tk.height > scrollView.contentY + scrollView.contentItem.height) {
scrollView.contentY = Math.min(trackHeaders.height - scrollView.height + scrollView.ScrollBar.horizontal.height, tk.y - scrollView.height / 3)
var newY = Math.min(trackHeaders.height - scrollView.height + scrollView.ScrollBar.horizontal.height, tk.y - scrollView.height / 3)
if (newY >= 0) {
scrollView.contentY = newY
}
}
}
......@@ -668,10 +672,6 @@ Rectangle {
// hack: change property to trigger transition adjustment
root.trackHeight = root.trackHeight === 1 ? 0 : 1
}
onClicked: {
timeline.activeTrack = tracksRepeater.itemAt(index).trackInternalId
console.log('track name: ',index, ' = ', model.name,'/',tracksRepeater.itemAt(index).trackInternalId)
}
}
}
}
......@@ -1165,7 +1165,7 @@ Rectangle {
width: tracksContainerArea.width
border.width: 1
border.color: root.frameColor
height: Math.max(root.baseUnit * 2, model.trackHeight)
height: Math.max(collapsedHeight, model.trackHeight)
color: tracksRepeater.itemAt(index) ? ((tracksRepeater.itemAt(index).trackInternalId === timeline.activeTrack) ? Qt.tint(getTrackColor(tracksRepeater.itemAt(index).isAudio, false), selectedTrackColor) : getTrackColor(tracksRepeater.itemAt(index).isAudio, false)) : 'red'
}
}
......
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