Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ui] ImageGallery: Add "Remove All Images" menu to clear all images #2221

Merged
merged 2 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions meshroom/ui/qml/ImageGallery/ImageDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Item {

signal pressed(var mouse)
signal removeRequest()
signal removeAllImagesRequest()

default property alias children: imageMA.children

Expand Down Expand Up @@ -78,6 +79,11 @@ Item {
enabled: !root.readOnly
onClicked: removeRequest()
}
MenuItem {
text: "Remove All Images"
cbentejac marked this conversation as resolved.
Show resolved Hide resolved
enabled: !root.readOnly
onClicked: removeAllImagesRequest()
}
MenuItem {
text: "Define As Center Image"
property var activeNode: _reconstruction ? _reconstruction.activeNodes.get("SfMTransform").node : null
Expand Down
16 changes: 15 additions & 1 deletion meshroom/ui/qml/ImageGallery/ImageGallery.qml
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,22 @@ Panel {
}
}

function removeAllImages() {
_reconstruction.clearImages()
_reconstruction.selectedViewId = "-1"
}

onRemoveRequest: sendRemoveRequest()
Keys.onDeletePressed: sendRemoveRequest()
Keys.onPressed: (event) => {
if (event.key === Qt.Key_Delete && event.modifiers === Qt.ShiftModifier) {
removeAllImages()
} else if (event.key === Qt.Key_Delete) {
sendRemoveRequest()
}
}
onRemoveAllImagesRequest: {
removeAllImages()
}

RowLayout {
anchors.top: parent.top
Expand Down