forked from qt-creator/qt-creator
Add the ability to unify keyframe handles
Task-number: QDS-568 Change-Id: I5b102423e8e166d41edf199c42305cee102e8b54 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -86,6 +86,7 @@ QToolBar *CurveEditor::createToolBar(CurveEditorModel *model)
|
||||
QAction *tangentStepAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsStepIcon.png"), "Step");
|
||||
QAction *tangentSplineAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsSplineIcon.png"), "Spline");
|
||||
QAction *tangentDefaultAction = bar->addAction("Set Default");
|
||||
QAction *tangentUnifyAction = bar->addAction("Unify");
|
||||
|
||||
auto setLinearInterpolation = [this]() {
|
||||
m_view->setInterpolation(Keyframe::Interpolation::Linear);
|
||||
@@ -97,9 +98,12 @@ QToolBar *CurveEditor::createToolBar(CurveEditorModel *model)
|
||||
m_view->setInterpolation(Keyframe::Interpolation::Bezier);
|
||||
};
|
||||
|
||||
auto toggleUnifyKeyframe = [this]() { m_view->toggleUnified(); };
|
||||
|
||||
connect(tangentLinearAction, &QAction::triggered, setLinearInterpolation);
|
||||
connect(tangentStepAction, &QAction::triggered, setStepInterpolation);
|
||||
connect(tangentSplineAction, &QAction::triggered, setSplineInterpolation);
|
||||
connect(tangentUnifyAction, &QAction::triggered, toggleUnifyKeyframe);
|
||||
|
||||
Q_UNUSED(tangentLinearAction);
|
||||
Q_UNUSED(tangentSplineAction);
|
||||
|
||||
Reference in New Issue
Block a user