diff options
author | Jere Tuliniemi <jere.tuliniemi@qt.io> | 2018-10-24 13:19:08 +0300 |
---|---|---|
committer | Jere Tuliniemi <jere.tuliniemi@qt.io> | 2018-10-30 13:11:10 +0000 |
commit | 8e63a378baeec44bca57cd9c698db0f216bee2a4 (patch) | |
tree | bc209e530a7aed5295da2a24773bf3347223a839 /src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp | |
parent | c4a3e6c5e5f24869b7901c770f22717c0b1da566 (diff) |
Add DnD from project view to timeline for mats
Task-number: QT3DS-2108
Change-Id: If193f23a73c0d107a817af834c32076cd72ae280
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp')
-rw-r--r-- | src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp index e3429d60..dcc04bfc 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp @@ -207,7 +207,8 @@ void RowMover::updateTargetRow(const QPointF &scenePos, EStudioObjectType rowTyp Q3DStudio::DocumentEditorFileType::Enum fileType) { // DnD a presentation / Qml stream from the project panel (to set it as a subpresentation) - if (rowType == OBJTYPE_PRESENTATION || rowType == OBJTYPE_QML_STREAM) { + if (rowType == OBJTYPE_PRESENTATION || rowType == OBJTYPE_QML_STREAM + || rowType == OBJTYPE_MATERIALDATA) { if (!m_insertionTarget.isNull()) m_insertionTarget->setDnDState(RowTree::DnDState::None, RowTree::DnDState::SP_TARGET); @@ -218,9 +219,18 @@ void RowMover::updateTargetRow(const QPointF &scenePos, EStudioObjectType rowTyp m_insertionTarget = rowAtMouse; m_insertType = Q3DStudio::DocumentEditorInsertType::LastChild; - if (rowAtMouse->rowType() == OBJTYPE_LAYER || rowAtMouse->rowType() == OBJTYPE_MATERIAL - || rowAtMouse->rowType() == OBJTYPE_IMAGE) { - m_insertionTarget->setDnDState(RowTree::DnDState::SP_TARGET); + if (rowType == OBJTYPE_MATERIALDATA) { + if (rowAtMouse->rowType() == OBJTYPE_MATERIAL + || rowAtMouse->rowType() == OBJTYPE_CUSTOMMATERIAL + || rowAtMouse->rowType() == OBJTYPE_REFERENCEDMATERIAL) { + m_insertionTarget->setDnDState(RowTree::DnDState::SP_TARGET); + } + } else { + if (rowAtMouse->rowType() == OBJTYPE_LAYER + || rowAtMouse->rowType() == OBJTYPE_MATERIAL + || rowAtMouse->rowType() == OBJTYPE_IMAGE) { + m_insertionTarget->setDnDState(RowTree::DnDState::SP_TARGET); + } } m_rowAutoExpand = rowAtMouse; m_autoExpandTimer.start(TimelineConstants::AUTO_EXPAND_TIME); |