Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Fix transition a_track visual feedback

parent bf506b8d
......@@ -41,6 +41,7 @@ Rectangle {
property bool isComposition: true
property bool grouped: false
property int binId: 0
property int trackHeight
property int trackIndex //Index in track repeater
property int trackId: -42 //Id in the model
property int a_track: -1
......@@ -74,6 +75,9 @@ Rectangle {
x = modelStart * timeScale;
width = clipDuration * timeScale;
}
onTrackHeightChanged: {
a_trackPos = root.getTrackYFromId(a_track) - mapToItem(trackRoot, 0, 0).y - trackRoot.mapToItem(null, 0, 0).y + ruler.height
}
SystemPalette { id: activePalette }
color: Qt.darker(getColor())
......@@ -138,14 +142,16 @@ Rectangle {
// target track
Rectangle {
width: parent.width
height: 5
color: 'red'
height: 8
gradient: Gradient {
GradientStop { position: 0.0; color: "mediumpurple" }
GradientStop { position: 1.0; color: "#00000000" }
}
y: a_trackPos
}
onA_trackChanged: {
console.log('+++++++++++++++++++++\na_tk: ', a_trackPos, ' : ', a_track)
a_trackPos = root.getTrackYFromId(a_track)
a_trackPos = root.getTrackYFromId(a_track) - mapToItem(trackRoot, 0, 0).y - trackRoot.mapToItem(null, 0, 0).y + ruler.height
}
states: [
......
......@@ -49,10 +49,11 @@ function getTrackIdFromPos(pos) {
}
function getTrackYFromId(id) {
if (id >= 0 && id < tracksRepeater.count) {
return trackHeaderRepeater.itemAt(id).y - scrollView.flickableItem.contentY
var result = - scrollView.flickableItem.contentY
for (var i = 0; i < id; i++) {
result += trackHeaderRepeater.itemAt(i).height
}
return -1
return result
}
function acceptDrop(xml) {
......
......@@ -75,6 +75,12 @@ Column{
value: loader.item.a_track
when: loader.item.isComposition && loader.status == Loader.Ready
}
Binding {
target: loader.item
property: "trackHeight"
value: root.trackHeight
when: loader.item.isComposition && loader.status == Loader.Ready
}
sourceComponent: {
if (model.isComposition) {
return compositionDelegate
......
......@@ -79,6 +79,7 @@ Rectangle {
property int droppedTrack: -1
property int clipBeingMovedId: -1
property real timeScale: timeline.scaleFactor
property int trackHeight
//property alias ripple: toolbar.ripple
//onCurrentTrackChanged: timeline.selection = []
......@@ -280,6 +281,8 @@ Rectangle {
trackBaseRepeater.itemAt(index).height = myTrackHeight
tracksRepeater.itemAt(index).height = myTrackHeight
height = myTrackHeight
// hack: change property to trigger transition adjustment
root.trackHeight = root.trackHeight === 1 ? 0 : 1
}
onClicked: {
currentTrack = index
......
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