Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 27 additions & 15 deletions meshroom/ui/qml/GraphEditor/Backdrop.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Item {
property var childrenIndices: []

property bool ctrlHeld: false
property bool dragging: mouseArea.drag.active
property bool dragging: headerMouseArea.drag.active
property bool resizing: leftDragger.drag.active || topDragger.drag.active
// Combined x and y
property point position: Qt.point(x, y)
Expand Down Expand Up @@ -149,24 +149,12 @@ Item {
id: mouseArea
width: root.width
height: root.height
drag.target: ctrlHeld ? undefined : root
// Small drag threshold to avoid moving the node by mistake
drag.threshold: 2
acceptedButtons: Qt.NoButton
hoverEnabled: true
acceptedButtons: Qt.LeftButton | Qt.RightButton
onPressed: (mouse) => root.pressed(mouse)
onReleased: (mouse) => root.released(mouse)
onClicked: (mouse) => root.clicked(mouse)
onDoubleClicked: (mouse) => root.doubleClicked(mouse)
onEntered: root.entered()
onExited: root.exited()
drag.onActiveChanged: {
if (!drag.active) {
root.moved(Qt.point(root.x, root.y))
}
}

cursorShape: drag.active ? Qt.ClosedHandCursor : Qt.ArrowCursor
cursorShape: Qt.ArrowCursor

// --- Backdrop Resize Controls
// Resize: diagonal bottom-right
Expand Down Expand Up @@ -466,6 +454,30 @@ Item {
font.pointSize: 8
}
}

// Header-only MouseArea: handles drag, click, and selection.
// Only the titlebar allows moving the backdrop to preserve standard
// rectangle selection behavior on the backdrop body.
MouseArea {
id: headerMouseArea
anchors.fill: parent
drag.target: ctrlHeld ? undefined : root
// Small drag threshold to avoid moving the node by mistake
drag.threshold: 2
hoverEnabled: true
acceptedButtons: Qt.LeftButton | Qt.RightButton
onPressed: (mouse) => root.pressed(mouse)
onReleased: (mouse) => root.released(mouse)
onClicked: (mouse) => root.clicked(mouse)
onDoubleClicked: (mouse) => root.doubleClicked(mouse)
drag.onActiveChanged: {
if (!drag.active) {
root.moved(Qt.point(root.x, root.y))
}
}

cursorShape: drag.active ? Qt.ClosedHandCursor : Qt.OpenHandCursor
}
}

// Vertical Spacer
Expand Down