diff --git a/gui/ChatPane.qml b/gui/ChatPane.qml index afeb75a..7a85ac8 100644 --- a/gui/ChatPane.qml +++ b/gui/ChatPane.qml @@ -1469,7 +1469,6 @@ Item { contentWidth: diagramZoomImg.width contentHeight: diagramZoomImg.height boundsBehavior: Flickable.StopAtBounds - interactive: false // disable default drag — we handle it via Ctrl+drag Image { id: diagramZoomImg @@ -1485,37 +1484,11 @@ Item { MouseArea { anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton - property real startX: 0 - property real startY: 0 - property real startContentX: 0 - property real startContentY: 0 - property bool panning: false - - onPressed: function(mouse) { - if (mouse.button === Qt.LeftButton && (mouse.modifiers & Qt.ControlModifier)) { - panning = true - startX = mouse.x - startY = mouse.y - startContentX = diagramFlick.contentX - startContentY = diagramFlick.contentY - mouse.accepted = true - } - } - onPositionChanged: function(mouse) { - if (panning) { - diagramFlick.contentX = Math.max(0, Math.min(diagramFlick.contentWidth - diagramFlick.width, startContentX - (mouse.x - startX))) - diagramFlick.contentY = Math.max(0, Math.min(diagramFlick.contentHeight - diagramFlick.height, startContentY - (mouse.y - startY))) - } - } - onReleased: function(mouse) { - panning = false - } + acceptedButtons: Qt.RightButton onClicked: function(mouse) { if (mouse.button === Qt.RightButton) diagramFullscreen.close() } - onDoubleClicked: 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)) diff --git a/gui/main-kf5.qml b/gui/main-kf5.qml index ba56aaa..81055cc 100644 --- a/gui/main-kf5.qml +++ b/gui/main-kf5.qml @@ -2279,7 +2279,6 @@ ApplicationWindow { contentWidth: diagramZoomImg.width contentHeight: diagramZoomImg.height boundsBehavior: Flickable.StopAtBounds - interactive: false // disable default drag — we handle it via Ctrl+drag Image { id: diagramZoomImg @@ -2294,37 +2293,11 @@ ApplicationWindow { MouseArea { anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton - property real startX: 0 - property real startY: 0 - property real startContentX: 0 - property real startContentY: 0 - property bool panning: false - - onPressed: function(mouse) { - if (mouse.button === Qt.LeftButton && (mouse.modifiers & Qt.ControlModifier)) { - panning = true - startX = mouse.x - startY = mouse.y - startContentX = diagramFlick.contentX - startContentY = diagramFlick.contentY - mouse.accepted = true - } - } - onPositionChanged: function(mouse) { - if (panning) { - diagramFlick.contentX = Math.max(0, Math.min(diagramFlick.contentWidth - diagramFlick.width, startContentX - (mouse.x - startX))) - diagramFlick.contentY = Math.max(0, Math.min(diagramFlick.contentHeight - diagramFlick.height, startContentY - (mouse.y - startY))) - } - } - onReleased: function(mouse) { - panning = false - } + acceptedButtons: Qt.RightButton onClicked: function(mouse) { if (mouse.button === Qt.RightButton) diagramFullscreen.close() } - onDoubleClicked: 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))