mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-04 01:08:26 +02:00
[ui] Viewer2D: add MouseArea on zoom item
* reset zoom to fit image on left click * right click menu
This commit is contained in:
parent
5f2cef7d9d
commit
85dd992927
1 changed files with 16 additions and 0 deletions
|
@ -326,6 +326,22 @@ FocusScope {
|
|||
Label {
|
||||
text: ((imgContainer.image && (imgContainer.image.status == Image.Ready)) ? imgContainer.scale.toFixed(2) : "1.00") + "x"
|
||||
state: "xsmall"
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onClicked: {
|
||||
if(mouse.button & Qt.LeftButton) {
|
||||
fit()
|
||||
}
|
||||
else if(mouse.button & Qt.RightButton) {
|
||||
var menu = contextMenu.createObject(root);
|
||||
var point = mapToItem(root, mouse.x, mouse.y)
|
||||
menu.x = point.x;
|
||||
menu.y = point.y;
|
||||
menu.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
MaterialToolButton {
|
||||
id: displayAlphaBackground
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue