diff --git a/gui/ChatPane.qml b/gui/ChatPane.qml index 7a85ac8..2aff4b8 100644 --- a/gui/ChatPane.qml +++ b/gui/ChatPane.qml @@ -1477,23 +1477,24 @@ Item { cache: false property real zoomFactor: 1.0 - // sourceSize gives us intrinsic dimensions; scale from Flickable size width: Math.max(diagramFlick.width, diagramFlick.width * zoomFactor) height: Math.max(diagramFlick.height, diagramFlick.height * zoomFactor) } + } - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.RightButton - onClicked: function(mouse) { - if (mouse.button === Qt.RightButton) - diagramFullscreen.close() - } - onWheel: function(wheel) { - let factor = wheel.angleDelta.y > 0 ? 1.15 : 0.87 - let newZoom = Math.max(0.25, Math.min(10.0, diagramZoomImg.zoomFactor * factor)) - diagramZoomImg.zoomFactor = newZoom - } + // Overlay for wheel zoom and right-click close (outside Flickable to avoid drag interference) + MouseArea { + anchors.fill: diagramFlick + acceptedButtons: Qt.RightButton + propagateComposedEvents: true + onClicked: function(mouse) { + if (mouse.button === Qt.RightButton) + diagramFullscreen.close() + } + onWheel: function(wheel) { + let factor = wheel.angleDelta.y > 0 ? 1.15 : 0.87 + let newZoom = Math.max(0.25, Math.min(10.0, diagramZoomImg.zoomFactor * factor)) + diagramZoomImg.zoomFactor = newZoom } } diff --git a/gui/main-kf5.qml b/gui/main-kf5.qml index 81055cc..ab9f73b 100644 --- a/gui/main-kf5.qml +++ b/gui/main-kf5.qml @@ -2290,19 +2290,21 @@ ApplicationWindow { width: Math.max(diagramFlick.width, diagramFlick.width * zoomFactor) height: Math.max(diagramFlick.height, diagramFlick.height * zoomFactor) } + } - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.RightButton - onClicked: function(mouse) { - if (mouse.button === Qt.RightButton) - diagramFullscreen.close() - } - onWheel: function(wheel) { - var factor = wheel.angleDelta.y > 0 ? 1.15 : 0.87 - var newZoom = Math.max(0.25, Math.min(10.0, diagramZoomImg.zoomFactor * factor)) - diagramZoomImg.zoomFactor = newZoom - } + // Overlay for wheel zoom and right-click close (outside Flickable to avoid drag interference) + MouseArea { + anchors.fill: diagramFlick + acceptedButtons: Qt.RightButton + propagateComposedEvents: true + onClicked: function(mouse) { + if (mouse.button === Qt.RightButton) + diagramFullscreen.close() + } + onWheel: function(wheel) { + var factor = wheel.angleDelta.y > 0 ? 1.15 : 0.87 + var newZoom = Math.max(0.25, Math.min(10.0, diagramZoomImg.zoomFactor * factor)) + diagramZoomImg.zoomFactor = newZoom } }