forked from qt-creator/qt-creator
QmlDesigner: Fix drag reset animation after drop on mac
Fixes: QDS-8933 Change-Id: Iab88c996c98e2f1eb01c0282445409411226ff95 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
@@ -50,11 +50,12 @@ Item {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height - y
|
height: parent.height - y
|
||||||
|
|
||||||
onEntered: (drag)=> {
|
onEntered: (drag) => {
|
||||||
root.updateDropExtFiles(drag)
|
root.updateDropExtFiles(drag)
|
||||||
}
|
}
|
||||||
|
|
||||||
onDropped: {
|
onDropped: (drag) => {
|
||||||
|
drag.accept()
|
||||||
rootView.handleExtFilesDrop(root.dropSimpleExtFiles,
|
rootView.handleExtFilesDrop(root.dropSimpleExtFiles,
|
||||||
root.dropComplexExtFiles,
|
root.dropComplexExtFiles,
|
||||||
assetsModel.rootPath())
|
assetsModel.rootPath())
|
||||||
@@ -194,11 +195,12 @@ Item {
|
|||||||
DropArea { // handles external drop (goes into default folder based on suffix)
|
DropArea { // handles external drop (goes into default folder based on suffix)
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
onEntered: (drag)=> {
|
onEntered: (drag) => {
|
||||||
root.updateDropExtFiles(drag)
|
root.updateDropExtFiles(drag)
|
||||||
}
|
}
|
||||||
|
|
||||||
onDropped: {
|
onDropped: (drag) => {
|
||||||
|
drag.accept()
|
||||||
rootView.emitExtFilesDrop(root.dropSimpleExtFiles, root.dropComplexExtFiles)
|
rootView.emitExtFilesDrop(root.dropSimpleExtFiles, root.dropComplexExtFiles)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -344,13 +344,14 @@ TreeView {
|
|||||||
let [row, item] = dropArea.__rowAndItem(drag)
|
let [row, item] = dropArea.__rowAndItem(drag)
|
||||||
|
|
||||||
if (item) {
|
if (item) {
|
||||||
root.endDropHover(row)
|
drag.accept()
|
||||||
|
root.endDropHover(row)
|
||||||
|
|
||||||
let dirPath = item.getDirPath()
|
let dirPath = item.getDirPath()
|
||||||
|
|
||||||
rootView.emitExtFilesDrop(root.assetsRoot.dropSimpleExtFiles,
|
rootView.emitExtFilesDrop(root.assetsRoot.dropSimpleExtFiles,
|
||||||
root.assetsRoot.dropComplexExtFiles,
|
root.assetsRoot.dropComplexExtFiles,
|
||||||
dirPath)
|
dirPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
dropArea.__isHoveringDrop = false
|
dropArea.__isHoveringDrop = false
|
||||||
|
@@ -503,7 +503,8 @@ Item {
|
|||||||
materialsSection.highlight = false
|
materialsSection.highlight = false
|
||||||
}
|
}
|
||||||
|
|
||||||
onDrop: {
|
onDrop: (drag) => {
|
||||||
|
drag.accept()
|
||||||
materialsSection.highlight = false
|
materialsSection.highlight = false
|
||||||
rootView.acceptBundleMaterialDrop()
|
rootView.acceptBundleMaterialDrop()
|
||||||
}
|
}
|
||||||
@@ -587,7 +588,8 @@ Item {
|
|||||||
highlight = false
|
highlight = false
|
||||||
}
|
}
|
||||||
|
|
||||||
onDrop: {
|
onDrop: (drag) => {
|
||||||
|
drag.accept()
|
||||||
highlight = false
|
highlight = false
|
||||||
rootView.acceptBundleTextureDrop()
|
rootView.acceptBundleTextureDrop()
|
||||||
}
|
}
|
||||||
|
@@ -51,6 +51,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onDropped: (drag) => {
|
onDropped: (drag) => {
|
||||||
|
drag.accept()
|
||||||
rootView.acceptTextureDropOnMaterial(index, drag.getDataAsString(drag.keys[0]))
|
rootView.acceptTextureDropOnMaterial(index, drag.getDataAsString(drag.keys[0]))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -69,7 +69,8 @@ StudioControls.ComboBox {
|
|||||||
|
|
||||||
onExited: comboBox.hasActiveHoverDrag = false
|
onExited: comboBox.hasActiveHoverDrag = false
|
||||||
|
|
||||||
onDropped: {
|
onDropped: (drag) => {
|
||||||
|
drag.accept()
|
||||||
comboBox.backendValue.commitDrop(dropArea.dropData)
|
comboBox.backendValue.commitDrop(dropArea.dropData)
|
||||||
comboBox.hasActiveHoverDrag = false
|
comboBox.hasActiveHoverDrag = false
|
||||||
}
|
}
|
||||||
|
@@ -636,7 +636,7 @@ bool NavigatorTreeModel::dropMimeData(const QMimeData *mimeData,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false; // don't let the view do drag&drop on its own
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigatorTreeModel::handleInternalDrop(const QMimeData *mimeData,
|
void NavigatorTreeModel::handleInternalDrop(const QMimeData *mimeData,
|
||||||
|
@@ -210,6 +210,7 @@ void NavigatorWidget::dragEnterEvent(QDragEnterEvent *dragEnterEvent)
|
|||||||
|
|
||||||
void NavigatorWidget::dropEvent(QDropEvent *dropEvent)
|
void NavigatorWidget::dropEvent(QDropEvent *dropEvent)
|
||||||
{
|
{
|
||||||
|
dropEvent->accept();
|
||||||
const DesignerActionManager &actionManager = QmlDesignerPlugin::instance()
|
const DesignerActionManager &actionManager = QmlDesignerPlugin::instance()
|
||||||
->viewManager().designerActionManager();
|
->viewManager().designerActionManager();
|
||||||
actionManager.handleExternalAssetsDrop(dropEvent->mimeData());
|
actionManager.handleExternalAssetsDrop(dropEvent->mimeData());
|
||||||
|
Reference in New Issue
Block a user