diff --git a/meshroom/ui/qml/Homepage.qml b/meshroom/ui/qml/Homepage.qml index 7708db3c17..98ff1a1733 100644 --- a/meshroom/ui/qml/Homepage.qml +++ b/meshroom/ui/qml/Homepage.qml @@ -361,6 +361,64 @@ Page { font.pointSize: 24 text: modelData["path"] ? (modelData["thumbnail"] ? "" : MaterialIcons.description) : MaterialIcons.folder_open + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton | Qt.RightButton + hoverEnabled: true + + onClicked: function(mouse) { + + if (mouse.button === Qt.RightButton) { + + if (!modelData["path"]) { return } + + projectContextMenu.x = mouse.x + projectContextMenu.y = mouse.y + projectContextMenu.open() + return + + } + + if (!modelData["path"]) { + initFileDialogFolder(openFileDialog) + openFileDialog.open() + } + + else { + // Open project + mainStack.push("Application.qml") + if (_reconstruction.load(modelData["path"])) { + MeshroomApp.addRecentProjectFile(modelData["path"]) + } else { + MeshroomApp.removeRecentProjectFile(modelData["path"]) + } + } + + } + + } + + Menu { + id: projectContextMenu + + MenuItem { + text: "Open" + onTriggered: { + if (_reconstruction.load(modelData["path"])) { + mainStack.push("Application.qml") + MeshroomApp.addRecentProjectFile(modelData["path"]) + } + } + } + + MenuItem { + text: "Delete" + onTriggered: { + MeshroomApp.removeRecentProjectFile(modelData["path"]) + } + } + } Image { id: thumbnail @@ -380,23 +438,6 @@ Page { visible: running } - Connections { - target: projectDelegate - function onClicked() { - if (!modelData["path"]) { - initFileDialogFolder(openFileDialog) - openFileDialog.open() - } else { - // Open project - mainStack.push("Application.qml") - if (_reconstruction.load(modelData["path"])) { - MeshroomApp.addRecentProjectFile(modelData["path"]) - } else { - MeshroomApp.removeRecentProjectFile(modelData["path"]) - } - } - } - } } Label { id: project