forked from qt-creator/qt-creator
QmlDesigner: Improve usability of boolean animation curves
Boolean animation curves are now painted from min to max of the value range instead of from 0 to 1. This allows to see value changes when the curve is loaded together with other animation curves of different value ranges. Boolean curves are now forced to be step interpolated. If the user tries other interpolation types the request is denied and an error message is written in the new status line. Added a status line that displays the current frame number by default and an informative text in case the user did something forbidden. Respect the current state when populating the curve editor. Fixes: QDS-6950 Fixes: QDS-6889 Change-Id: Ia5fa1c1c55ee93eda5a39fd83987b54fb41d54db Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -36,14 +36,16 @@
|
||||
namespace QmlDesigner {
|
||||
|
||||
AnimationCurve::AnimationCurve()
|
||||
: m_fromData(false)
|
||||
: m_type(AnimationCurve::ValueType::Undefined)
|
||||
, m_fromData(false)
|
||||
, m_minY(std::numeric_limits<double>::max())
|
||||
, m_maxY(std::numeric_limits<double>::lowest())
|
||||
, m_frames()
|
||||
{}
|
||||
|
||||
AnimationCurve::AnimationCurve(const std::vector<Keyframe> &frames)
|
||||
: m_fromData(false)
|
||||
AnimationCurve::AnimationCurve(AnimationCurve::ValueType type, const std::vector<Keyframe> &frames)
|
||||
: m_type(type)
|
||||
, m_fromData(false)
|
||||
, m_minY(std::numeric_limits<double>::max())
|
||||
, m_maxY(std::numeric_limits<double>::lowest())
|
||||
, m_frames(frames)
|
||||
@@ -51,8 +53,13 @@ AnimationCurve::AnimationCurve(const std::vector<Keyframe> &frames)
|
||||
analyze();
|
||||
}
|
||||
|
||||
AnimationCurve::AnimationCurve(const QEasingCurve &easing, const QPointF &start, const QPointF &end)
|
||||
: m_fromData(true)
|
||||
AnimationCurve::AnimationCurve(
|
||||
AnimationCurve::ValueType type,
|
||||
const QEasingCurve &easing,
|
||||
const QPointF &start,
|
||||
const QPointF &end)
|
||||
: m_type(type)
|
||||
, m_fromData(true)
|
||||
, m_minY(std::numeric_limits<double>::max())
|
||||
, m_maxY(std::numeric_limits<double>::lowest())
|
||||
, m_frames()
|
||||
@@ -117,6 +124,11 @@ bool AnimationCurve::hasUnified() const
|
||||
return false;
|
||||
}
|
||||
|
||||
AnimationCurve::ValueType AnimationCurve::valueType() const
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
double AnimationCurve::minimumTime() const
|
||||
{
|
||||
if (!m_frames.empty())
|
||||
|
||||
Reference in New Issue
Block a user