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

Make time remap a checkable option in the context menu so it can easily be removed

parent f6048bd1
......@@ -1655,6 +1655,9 @@ void MainWindow::setupActions()
act = addAction(QStringLiteral("edit_item_remap"), i18n("Time Remap"), this, SLOT(slotRemapItemTime()),
QIcon::fromTheme(QStringLiteral("speedometer")), QKeySequence(), clipActionCategory);
// "C" as data means this action should only be available for clips - not for compositions
act->setData('R');
act->setCheckable(true);
act->setEnabled(false);
act = addAction(QStringLiteral("clip_in_project_tree"), i18n("Clip in Project Bin"), this, SLOT(slotClipInProjectTree()),
......
......@@ -2208,7 +2208,14 @@ void TimelineController::remapItemTime(int clipId, double speed)
pCore->displayMessage(i18n("No item to edit"), ErrorMessage, 500);
return;
}
pCore->remapClip(clipId);
if (m_model->m_allClips[clipId]->isChain()) {
// Remove remap effect
m_model->requestClipTimeRemap(clipId, false);
pCore->remapClip(-1);
} else {
// Add remap effect
pCore->remapClip(clipId);
}
}
void TimelineController::changeItemSpeed(int clipId, double speed)
......@@ -3354,6 +3361,11 @@ void TimelineController::updateClipActions()
} else if (actionData == QLatin1Char('P')) {
// Position actions should stay enabled in clip monitor
enableAction = true;
} else if (actionData == QLatin1Char('R')) {
enableAction = clip != nullptr;
if (enableAction) {
act->setChecked(clip->isChain());
}
}
act->setEnabled(enableAction);
}
......
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