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

Remember track state (collapsed)

parent eab9f617
......@@ -171,6 +171,7 @@ bool constructTrackFromMelt(const std::shared_ptr<TimelineItemModel> &timeline,
// Pass track properties
int height = track.get_int("kdenlive:trackheight");
timeline->setTrackProperty(tid, "kdenlive:trackheight", height == 0 ? "100" : QString::number(height));
timeline->setTrackProperty(tid, "kdenlive:collapsed", QString::number(track.get_int("kdenlive:collapsed")));
QString trackName = track.get("kdenlive:track_name");
if (!trackName.isEmpty()) {
timeline->setTrackProperty(tid, QStringLiteral("kdenlive:track_name"), trackName.toUtf8().constData());
......
......@@ -317,6 +317,10 @@ QVariant TimelineItemModel::data(const QModelIndex &index, int role) const
case IsLockedRole:
return getTrackById_const(id)->getProperty("kdenlive:locked_track").toInt() == 1;
case HeightRole: {
int collapsed = getTrackById_const(id)->getProperty("kdenlive:collapsed").toInt();
if ( collapsed > 0) {
return collapsed;
}
int height = getTrackById_const(id)->getProperty("kdenlive:trackheight").toInt();
// qDebug() << "DATA yielding height" << height;
return (height > 0 ? height : 60);
......
......@@ -196,9 +196,8 @@ Rectangle {
]
}
}
Rectangle {
Item {
// Spacer
color: "transparent"
Layout.fillWidth: true
Layout.fillHeight: true
}
......@@ -313,9 +312,9 @@ Rectangle {
}
}
}
Rectangle {
Item {
// Spacer
color: "transparent"
id: spacer
Layout.fillWidth: true
Layout.fillHeight: true
}
......@@ -347,6 +346,7 @@ Rectangle {
onReleased: {
root.stopScrolling = false
parent.opacity = 0
resizer.y = spacer.y + spacer.height
}
onEntered: parent.opacity = 0.5
onExited: parent.opacity = 0
......
......@@ -485,6 +485,7 @@ Rectangle {
current: item === timeline.activeTrack
trackId: item
onIsLockedChanged: tracksRepeater.itemAt(index).isLocked = isLocked
collapsed: height <= collapsedHeight
onMyTrackHeightChanged: {
trackBaseRepeater.itemAt(index).height = myTrackHeight
tracksRepeater.itemAt(index).height = myTrackHeight
......@@ -492,6 +493,9 @@ Rectangle {
collapsed = height <= collapsedHeight
if (!collapsed) {
controller.setTrackProperty(trackId, "kdenlive:trackheight", myTrackHeight)
controller.setTrackProperty(trackId, "kdenlive:collapsed", "0")
} else {
controller.setTrackProperty(trackId, "kdenlive:collapsed", collapsedHeight)
}
// hack: change property to trigger transition adjustment
root.trackHeight = root.trackHeight === 1 ? 0 : 1
......
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