Changeset View
Changeset View
Standalone View
Standalone View
src/assets/view/widgets/animationwidget.cpp
Show First 20 Lines • Show All 798 Lines • ▼ Show 20 Line(s) | 798 | new DoubleWidget(paramName, 0, m_model->data(ix, AssetParameterModel::MinRole).toDouble(), m_model->data(ix, AssetParameterModel::MaxRole).toDouble(), | |||
---|---|---|---|---|---|
799 | m_model->data(ix, AssetParameterModel::DefaultRole).toDouble() * factor, comment, index, | 799 | m_model->data(ix, AssetParameterModel::DefaultRole).toDouble() * factor, comment, index, | ||
800 | m_model->data(ix, AssetParameterModel::SuffixRole).toString(), m_model->data(ix, AssetParameterModel::DecimalsRole).toInt(), this); | 800 | m_model->data(ix, AssetParameterModel::SuffixRole).toString(), m_model->data(ix, AssetParameterModel::DecimalsRole).toInt(), this); | ||
801 | doubleparam->setObjectName(paramTag); | 801 | doubleparam->setObjectName(paramTag); | ||
802 | doubleparam->setProperty("index", ix); | 802 | doubleparam->setProperty("index", ix); | ||
803 | doubleparam->factor = factor; | 803 | doubleparam->factor = factor; | ||
804 | connect(doubleparam, &DoubleWidget::valueChanged, this, &AnimationWidget::slotAdjustKeyframeValue); | 804 | connect(doubleparam, &DoubleWidget::valueChanged, this, &AnimationWidget::slotAdjustKeyframeValue); | ||
805 | layout()->addWidget(doubleparam); | 805 | layout()->addWidget(doubleparam); | ||
806 | 806 | | |||
807 | m_monitor->setEffectSceneProperty(QStringLiteral("showRotation"), true); | ||||
808 | m_rotationWidget = DoubleWidget *doubleparam; | ||||
807 | // TODO: in timeline | 809 | // TODO: in timeline | ||
808 | /*if ((!e.hasAttribute(QStringLiteral("intimeline")) || e.attribute(QStringLiteral("intimeline")) == QLatin1String("1")) && | 810 | /*if ((!e.hasAttribute(QStringLiteral("intimeline")) || e.attribute(QStringLiteral("intimeline")) == QLatin1String("1")) && | ||
809 | !e.hasAttribute(QStringLiteral("notintimeline"))) {*/ | 811 | !e.hasAttribute(QStringLiteral("notintimeline"))) {*/ | ||
810 | { | 812 | { | ||
811 | m_inTimeline = paramTag; | 813 | m_inTimeline = paramTag; | ||
812 | m_animController = m_animProperties.get_animation(m_inTimeline.toUtf8().constData()); | 814 | m_animController = m_animProperties.get_animation(m_inTimeline.toUtf8().constData()); | ||
813 | } | 815 | } | ||
814 | m_doubleWidgets.insert(paramTag, doubleparam); | 816 | m_doubleWidgets.insert(paramTag, doubleparam); | ||
Show All 39 Lines | 820 | { | |||
854 | m_spinSize->setStep(10); | 856 | m_spinSize->setStep(10); | ||
855 | connect(m_spinSize, &DragValue::valueChanged, this, &AnimationWidget::slotResize); | 857 | connect(m_spinSize, &DragValue::valueChanged, this, &AnimationWidget::slotResize); | ||
856 | horLayout2->addWidget(m_spinSize); | 858 | horLayout2->addWidget(m_spinSize); | ||
857 | if (m_model->data(ix, AssetParameterModel::OpacityRole).toBool()) { | 859 | if (m_model->data(ix, AssetParameterModel::OpacityRole).toBool()) { | ||
858 | m_spinOpacity = new DragValue(i18n("Opacity"), 100, 0, 0, 100, -1, i18n("%"), true, this); | 860 | m_spinOpacity = new DragValue(i18n("Opacity"), 100, 0, 0, 100, -1, i18n("%"), true, this); | ||
859 | connect(m_spinOpacity, &DragValue::valueChanged, this, &AnimationWidget::slotAdjustRectKeyframeValue); | 861 | connect(m_spinOpacity, &DragValue::valueChanged, this, &AnimationWidget::slotAdjustRectKeyframeValue); | ||
860 | horLayout2->addWidget(m_spinOpacity); | 862 | horLayout2->addWidget(m_spinOpacity); | ||
861 | } | 863 | } | ||
862 | 864 | m_monitor->setEffectSceneProperty(QStringLiteral("showOpacity"),m_spinOpacity!=nullptr); | |||
863 | // Build buttons | 865 | // Build buttons | ||
864 | m_originalSize = new QAction(KoIconUtils::themedIcon(QStringLiteral("zoom-original")), i18n("Adjust to original size"), this); | 866 | m_originalSize = new QAction(KoIconUtils::themedIcon(QStringLiteral("zoom-original")), i18n("Adjust to original size"), this); | ||
865 | connect(m_originalSize, &QAction::triggered, this, &AnimationWidget::slotAdjustToSource); | 867 | connect(m_originalSize, &QAction::triggered, this, &AnimationWidget::slotAdjustToSource); | ||
866 | m_originalSize->setCheckable(true); | 868 | m_originalSize->setCheckable(true); | ||
867 | QAction *adjustSize = new QAction(KoIconUtils::themedIcon(QStringLiteral("zoom-fit-best")), i18n("Adjust and center in frame"), this); | 869 | QAction *adjustSize = new QAction(KoIconUtils::themedIcon(QStringLiteral("zoom-fit-best")), i18n("Adjust and center in frame"), this); | ||
868 | connect(adjustSize, &QAction::triggered, this, &AnimationWidget::slotAdjustToFrameSize); | 870 | connect(adjustSize, &QAction::triggered, this, &AnimationWidget::slotAdjustToFrameSize); | ||
869 | QAction *fitToWidth = new QAction(KoIconUtils::themedIcon(QStringLiteral("zoom-fit-width")), i18n("Fit to width"), this); | 871 | QAction *fitToWidth = new QAction(KoIconUtils::themedIcon(QStringLiteral("zoom-fit-width")), i18n("Fit to width"), this); | ||
870 | connect(fitToWidth, &QAction::triggered, this, &AnimationWidget::slotFitToWidth); | 872 | connect(fitToWidth, &QAction::triggered, this, &AnimationWidget::slotFitToWidth); | ||
▲ Show 20 Lines • Show All 816 Lines • ▼ Show 20 Line(s) | |||||
1687 | void AnimationWidget::slotSetRange(QPair<int, int> range) | 1689 | void AnimationWidget::slotSetRange(QPair<int, int> range) | ||
1688 | { | 1690 | { | ||
1689 | m_inPoint = range.first; | 1691 | m_inPoint = range.first; | ||
1690 | m_outPoint = range.second; | 1692 | m_outPoint = range.second; | ||
1691 | m_offset = m_model->data(m_index, AssetParameterModel::InRole).toInt(); | 1693 | m_offset = m_model->data(m_index, AssetParameterModel::InRole).toInt(); | ||
1692 | m_ruler->setRange(0, m_outPoint - m_inPoint); | 1694 | m_ruler->setRange(0, m_outPoint - m_inPoint); | ||
1693 | m_timePos->setRange(0, m_outPoint - m_inPoint - 1); | 1695 | m_timePos->setRange(0, m_outPoint - m_inPoint - 1); | ||
1694 | } | 1696 | } | ||
1697 | |