mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-02 16:28:51 +02:00
[ui] Viewer Fisheye Circle: disable MouseArea when unused
As the events cannot be propagated all the time as needed, at least unload the MouseArea when unused so the events are propagated.
This commit is contained in:
parent
f19797c58f
commit
9ef6eb48fc
1 changed files with 31 additions and 27 deletions
|
@ -59,37 +59,41 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mArea
|
||||
enabled: !root.readOnly
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
cursorShape: root.readOnly ? Qt.ArrowCursor : (controlModifierEnabled ? Qt.SizeBDiagCursor : (pressed ? Qt.ClosedHandCursor : Qt.OpenHandCursor))
|
||||
propagateComposedEvents: true
|
||||
active: !root.readOnly
|
||||
|
||||
property bool controlModifierEnabled: false
|
||||
onPositionChanged: {
|
||||
mArea.controlModifierEnabled = (mouse.modifiers & Qt.ControlModifier)
|
||||
mouse.accepted = false;
|
||||
}
|
||||
acceptedButtons: Qt.LeftButton
|
||||
hoverEnabled: true
|
||||
drag.target: parent
|
||||
sourceComponent: MouseArea {
|
||||
id: mArea
|
||||
anchors.fill: parent
|
||||
cursorShape: root.readOnly ? Qt.ArrowCursor : (controlModifierEnabled ? Qt.SizeBDiagCursor : (pressed ? Qt.ClosedHandCursor : Qt.OpenHandCursor))
|
||||
propagateComposedEvents: true
|
||||
|
||||
drag.onActiveChanged: {
|
||||
if(!drag.active) {
|
||||
moved();
|
||||
property bool controlModifierEnabled: false
|
||||
onPositionChanged: {
|
||||
mArea.controlModifierEnabled = (mouse.modifiers & Qt.ControlModifier)
|
||||
mouse.accepted = false;
|
||||
}
|
||||
}
|
||||
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;
|
||||
acceptedButtons: Qt.LeftButton
|
||||
hoverEnabled: true
|
||||
drag.target: root
|
||||
|
||||
drag.onActiveChanged: {
|
||||
if(!drag.active) {
|
||||
moved();
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue