mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-04 01:08:26 +02:00
[ui] mouse: add "Ctrl+Left click" as an alternative to Middle click
This commit is contained in:
parent
2eb2c3ac6f
commit
10026e3281
3 changed files with 9 additions and 9 deletions
|
@ -114,6 +114,13 @@ Entity {
|
|||
components: [
|
||||
FrameAction {
|
||||
onTriggered: {
|
||||
if(actionMMB.active || (actionLMB.active && actionControl.active)) { // translate
|
||||
var d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.03;
|
||||
var tx = axisMX.value * root.translateSpeed * d;
|
||||
var ty = axisMY.value * root.translateSpeed * d;
|
||||
root.camera.translate(Qt.vector3d(-tx, -ty, 0).times(dt))
|
||||
return;
|
||||
}
|
||||
if(actionLMB.active) { // rotate
|
||||
var rx = -axisMX.value;
|
||||
var ry = -axisMY.value;
|
||||
|
@ -121,13 +128,6 @@ Entity {
|
|||
root.camera.tiltAboutViewCenter(root.tiltSpeed * ry * dt)
|
||||
return;
|
||||
}
|
||||
if(actionMMB.active) { // translate
|
||||
var d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.03;
|
||||
var tx = axisMX.value * root.translateSpeed * d;
|
||||
var ty = axisMY.value * root.translateSpeed * d;
|
||||
root.camera.translate(Qt.vector3d(-tx, -ty, 0).times(dt))
|
||||
return;
|
||||
}
|
||||
if(actionAlt.active && actionRMB.active) { // zoom with alt + RMD
|
||||
var d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.1;
|
||||
var tz = axisMX.value * root.translateSpeed * d;
|
||||
|
|
|
@ -93,7 +93,7 @@ FocusScope {
|
|||
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||
onPressed: {
|
||||
image.forceActiveFocus()
|
||||
if(mouse.button & Qt.MiddleButton)
|
||||
if(mouse.button & Qt.MiddleButton || (mouse.button & Qt.LeftButton && mouse.modifiers & Qt.ControlModifier))
|
||||
drag.target = image // start drag
|
||||
}
|
||||
onReleased: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue