Changeset View
Changeset View
Standalone View
Standalone View
plugins/dockers/animation/timeline_frames_view.cpp
Show First 20 Lines • Show All 381 Lines • ▼ Show 20 Line(s) | 377 | if (m_d->horizontalRuler->setZoom(zoomLevel)) { | |||
---|---|---|---|---|---|
382 | 382 | | |||
383 | viewport()->update(); | 383 | viewport()->update(); | ||
384 | } | 384 | } | ||
385 | } | 385 | } | ||
386 | 386 | | |||
387 | void TimelineFramesView::slotColorLabelChanged(int label) | 387 | void TimelineFramesView::slotColorLabelChanged(int label) | ||
388 | { | 388 | { | ||
389 | Q_FOREACH(QModelIndex index, selectedIndexes()) { | 389 | Q_FOREACH(QModelIndex index, selectedIndexes()) { | ||
390 | m_d->model->setData(index, label, TimelineFramesModel::ColorLabel); | 390 | m_d->model->setData(index, label, TimelineFramesModel::FrameColorLabelIndexRole); | ||
391 | } | 391 | } | ||
392 | 392 | | |||
393 | KisImageConfig config; | 393 | KisImageConfig config; | ||
394 | config.setDefaultFrameColorLabel(label); | 394 | config.setDefaultFrameColorLabel(label); | ||
395 | } | 395 | } | ||
396 | 396 | | |||
397 | void TimelineFramesView::slotSelectAudioChannelFile() | 397 | void TimelineFramesView::slotSelectAudioChannelFile() | ||
398 | { | 398 | { | ||
▲ Show 20 Lines • Show All 457 Lines • ▼ Show 20 Line(s) | 851 | if (index.isValid() && | |||
856 | model()->setData(index, true, TimelineFramesModel::ActiveFrameRole); | 856 | model()->setData(index, true, TimelineFramesModel::ActiveFrameRole); | ||
857 | setCurrentIndex(index); | 857 | setCurrentIndex(index); | ||
858 | 858 | | |||
859 | if (model()->data(index, TimelineFramesModel::FrameExistsRole).toBool() || | 859 | if (model()->data(index, TimelineFramesModel::FrameExistsRole).toBool() || | ||
860 | model()->data(index, TimelineFramesModel::SpecialKeyframeExists).toBool()) { | 860 | model()->data(index, TimelineFramesModel::SpecialKeyframeExists).toBool()) { | ||
861 | 861 | | |||
862 | { | 862 | { | ||
863 | KisSignalsBlocker b(m_d->colorSelector); | 863 | KisSignalsBlocker b(m_d->colorSelector); | ||
864 | QVariant colorLabel = index.data(TimelineFramesModel::ColorLabel); | 864 | QVariant colorLabel = index.data(TimelineFramesModel::FrameColorLabelIndexRole); | ||
865 | int labelIndex = colorLabel.isValid() ? colorLabel.toInt() : 0; | 865 | int labelIndex = colorLabel.isValid() ? colorLabel.toInt() : 0; | ||
866 | m_d->colorSelector->setCurrentIndex(labelIndex); | 866 | m_d->colorSelector->setCurrentIndex(labelIndex); | ||
867 | } | 867 | } | ||
868 | 868 | | |||
869 | m_d->frameEditingMenu->exec(event->globalPos()); | 869 | m_d->frameEditingMenu->exec(event->globalPos()); | ||
870 | } else { | 870 | } else { | ||
871 | m_d->frameCreationMenu->exec(event->globalPos()); | 871 | m_d->frameCreationMenu->exec(event->globalPos()); | ||
872 | } | 872 | } | ||
873 | } else if (numSelectedItems > 1) { | 873 | } else if (numSelectedItems > 1) { | ||
874 | int labelIndex = 0; | 874 | int labelIndex = 0; | ||
875 | bool haveFrames = false; | 875 | bool haveFrames = false; | ||
876 | Q_FOREACH(QModelIndex index, selectedIndexes()) { | 876 | Q_FOREACH(QModelIndex index, selectedIndexes()) { | ||
877 | haveFrames |= index.data(TimelineFramesModel::FrameExistsRole).toBool(); | 877 | haveFrames |= index.data(TimelineFramesModel::FrameExistsRole).toBool(); | ||
878 | QVariant colorLabel = index.data(TimelineFramesModel::ColorLabel); | 878 | QVariant colorLabel = index.data(TimelineFramesModel::FrameColorLabelIndexRole); | ||
879 | if (colorLabel.isValid()) { | 879 | if (colorLabel.isValid()) { | ||
880 | if (labelIndex == 0) { | 880 | if (labelIndex == 0) { | ||
881 | labelIndex = colorLabel.toInt(); | 881 | labelIndex = colorLabel.toInt(); | ||
882 | } else { | 882 | } else { | ||
883 | labelIndex = 0; | 883 | labelIndex = 0; | ||
884 | break; | 884 | break; | ||
885 | } | 885 | } | ||
886 | } | 886 | } | ||
▲ Show 20 Lines • Show All 176 Lines • Show Last 20 Lines |