Commit 2518ec46 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Revert "Merge branch '1904'"

This reverts commit 4e24c955, reversing
changes made to f29a1ed9.
parent 4e24c955
Pipeline #2186 failed with stage
in 21 minutes and 58 seconds
......@@ -452,8 +452,6 @@ void TimelineItemModel::setTrackProperty(int trackId, const QString &name, const
roles.push_back(TrackActiveRole);
} else if (name == QLatin1String("kdenlive:thumbs_format")) {
roles.push_back(ThumbsFormatRole);
} else if (name == QLatin1String("kdenlive:collapsed")) {
roles.push_back(HeightRole);
} else if (name == QLatin1String("kdenlive:audio_rec")) {
roles.push_back(AudioRecordRole);
}
......
......@@ -33,6 +33,7 @@ Column{
property int trackInternalId : -42
property int trackThumbsFormat
property int itemType: 0
height: parent.height
/*function redrawWaveforms() {
for (var i = 0; i < repeater.count; i++)
......
......@@ -45,6 +45,10 @@ Rectangle {
border.color: root.frameColor
signal clicked()
onCollapsedChanged: {
resizer.y = trackHeadRoot.height - resizer.height
}
function pulseLockButton() {
flashLock.restart();
}
......@@ -459,14 +463,11 @@ Rectangle {
}
onReleased: {
root.stopScrolling = false
if (!trimInMouseArea.containsMouse) {
parent.opacity = 0
}
if (mouse.modifiers & Qt.ShiftModifier) {
timeline.adjustAllTrackHeight(trackHeadRoot.trackId, trackHeadRoot.myTrackHeight)
}
parent.opacity = 0
parent.y = trackHeadRoot.height - parent.height
//resizer.y = spacer.y + spacer.height
}
onEntered: parent.opacity = 0.3
onEntered: parent.opacity = 0.5
onExited: parent.opacity = 0
onPositionChanged: {
if (mouse.buttons === Qt.LeftButton) {
......
......@@ -646,13 +646,16 @@ Rectangle {
effectNames: model.effectNames
isStackEnabled: model.isStackEnabled
width: headerWidth
height: model.trackHeight
current: item === timeline.activeTrack
trackId: item
height: model.trackHeight
onIsLockedChanged: tracksRepeater.itemAt(index).isLocked = isLocked
collapsed: height <= collapsedHeight
onMyTrackHeightChanged: {
collapsed = myTrackHeight <= collapsedHeight
trackBaseRepeater.itemAt(index).height = myTrackHeight
tracksRepeater.itemAt(index).height = myTrackHeight
height = myTrackHeight
collapsed = height <= collapsedHeight
if (!collapsed) {
controller.setTrackProperty(trackId, "kdenlive:trackheight", myTrackHeight)
controller.setTrackProperty(trackId, "kdenlive:collapsed", "0")
......@@ -1278,6 +1281,7 @@ Rectangle {
delegate: Track {
trackModel: multitrack
rootIndex: trackDelegateModel.modelIndex(index)
height: trackHeight
timeScale: timeline.scaleFactor
width: tracksContainerArea.width
isAudio: audio
......
......@@ -676,23 +676,6 @@ void TimelineController::showTrackAsset(int trackId)
emit showItemEffectStack(getTrackNameFromIndex(trackId), m_model->getTrackEffectStackModel(trackId), pCore->getCurrentFrameSize(), false);
}
void TimelineController::adjustAllTrackHeight(int trackId, int height)
{
bool isAudio = m_model->getTrackById_const(trackId)->isAudioTrack();
auto it = m_model->m_allTracks.cbegin();
while (it != m_model->m_allTracks.cend()) {
int target_track = (*it)->getId();
if (target_track != trackId && m_model->getTrackById_const(target_track)->isAudioTrack() == isAudio) {
m_model->getTrackById(target_track)->setProperty(QStringLiteral("kdenlive:trackheight"), QString::number(height));
}
++it;
}
int tracksCount = m_model->getTracksCount();
QModelIndex modelStart = m_model->makeTrackIndexFromID(m_model->getTrackIndexFromPosition(0));
QModelIndex modelEnd = m_model->makeTrackIndexFromID(m_model->getTrackIndexFromPosition(tracksCount - 1));
m_model->dataChanged(modelStart, modelEnd, {TimelineModel::HeightRole});
}
void TimelineController::setPosition(int position)
{
setSeekPosition(position);
......
......@@ -246,9 +246,6 @@ public:
*/
Q_INVOKABLE void showAsset(int id);
Q_INVOKABLE void showTrackAsset(int trackId);
/* @brief Adjust height of all simlar (audio or video) tracks
*/
Q_INVOKABLE void adjustAllTrackHeight(int trackId, int height);
Q_INVOKABLE bool exists(int itemId);
......
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