Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions meshroom/ui/qml/Application.qml
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,14 @@ Page {
}
}
}
Action {
id: projectsPage
text: "Projects ..."
onTriggered: {
const homepage = mainStack.replace("Homepage.qml")
homepage.setCurrentTab("Projects")
}
}
MenuSeparator { }
Action {
id: saveAction
Expand Down
81 changes: 63 additions & 18 deletions meshroom/ui/qml/Homepage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ import Controls 1.0
Page {
id: root

function setCurrentTab(tabName) {
const tabIndex = tabPanel.tabs.indexOf(tabName)

if (tabIndex) {
tabPanel.currentTab = tabIndex
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this function still necessary with the recent changes? I don't see it used anywhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx, you're right, it's an oversight.

onVisibleChanged: {
logo.playing = false
if (visible) {
Expand Down Expand Up @@ -361,28 +369,25 @@ 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

Image {
id: thumbnail
visible: modelData["thumbnail"]
cache: false
asynchronous: true
onClicked: function(mouse) {
if (mouse.button === Qt.RightButton) {

fillMode: Image.PreserveAspectCrop
if (!modelData["path"]) { return }

width: projectDelegate.width
height: projectDelegate.height
}

BusyIndicator {
anchors.centerIn: parent
running: gridView.visible && modelData["thumbnail"] && thumbnail.status != Image.Ready
visible: running
}
projectContextMenu.x = mouse.x
projectContextMenu.y = mouse.y
projectContextMenu.open()

}
}

Connections {
target: projectDelegate
function onClicked() {
onDoubleClicked: {
if (!modelData["path"]) {
initFileDialogFolder(openFileDialog)
openFileDialog.open()
Expand All @@ -397,6 +402,46 @@ Page {
}
}
}

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
visible: modelData["thumbnail"]
cache: false
asynchronous: true

fillMode: Image.PreserveAspectCrop

width: projectDelegate.width
height: projectDelegate.height
}

BusyIndicator {
anchors.centerIn: parent
running: gridView.visible && modelData["thumbnail"] && thumbnail.status != Image.Ready
visible: running
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespaces


}
Label {
id: project
Expand Down