mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-04 01:08:26 +02:00
[ui] Viewer2D: allow to change the size of the Fisheye circle with Ctrl+Wheel
* also add forceActiveFocus() to release other focus areas
This commit is contained in:
parent
e933e1adf6
commit
e88651ba01
2 changed files with 22 additions and 9 deletions
|
@ -4,6 +4,7 @@ Rectangle {
|
|||
id: root
|
||||
|
||||
signal moved()
|
||||
signal incrementRadius(real radiusOffset)
|
||||
|
||||
width: radius * 2
|
||||
height: width
|
||||
|
@ -32,21 +33,30 @@ Rectangle {
|
|||
MouseArea {
|
||||
id: mArea
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.OpenHandCursor
|
||||
cursorShape: controlModifierEnabled ? Qt.SizeBDiagCursor : (pressed ? Qt.ClosedHandCursor : Qt.OpenHandCursor)
|
||||
property bool controlModifierEnabled: false
|
||||
onPositionChanged: {
|
||||
mArea.controlModifierEnabled = (mouse.modifiers & Qt.ControlModifier)
|
||||
}
|
||||
acceptedButtons: Qt.LeftButton
|
||||
hoverEnabled: true
|
||||
drag.target: parent
|
||||
|
||||
drag.onActiveChanged:
|
||||
{
|
||||
if(!drag.active)
|
||||
{
|
||||
cursorShape = Qt.OpenHandCursor;
|
||||
drag.onActiveChanged: {
|
||||
if(!drag.active) {
|
||||
moved();
|
||||
}
|
||||
else
|
||||
{
|
||||
cursorShape = Qt.ClosedHandCursor;
|
||||
}
|
||||
onPressed: {
|
||||
forceActiveFocus();
|
||||
}
|
||||
onWheel: {
|
||||
mArea.controlModifierEnabled = (wheel.modifiers & Qt.ControlModifier)
|
||||
if (wheel.modifiers & Qt.ControlModifier) {
|
||||
incrementRadius(wheel.angleDelta.y / 120.0);
|
||||
wheel.accepted = true;
|
||||
} else {
|
||||
wheel.accepted = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -260,6 +260,9 @@ FocusScope {
|
|||
_reconstruction.setAttribute(_reconstruction.panoramaInit.attribute("fisheyeCenterOffset.fisheyeCenterOffset_x"), x)
|
||||
_reconstruction.setAttribute(_reconstruction.panoramaInit.attribute("fisheyeCenterOffset.fisheyeCenterOffset_y"), y)
|
||||
}
|
||||
onIncrementRadius: {
|
||||
_reconstruction.setAttribute(_reconstruction.panoramaInit.attribute("fisheyeRadius"), _reconstruction.panoramaInit.attribute("fisheyeRadius").value + radiusOffset)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue