fix drawing input anchoring incorrectly when using loader

This commit is contained in:
2026-05-27 12:03:06 +02:00
parent 3963a48a9d
commit d92e5b4cd7
4 changed files with 7 additions and 8 deletions
+2 -2
View File
@@ -22,20 +22,20 @@ CustomMouseArea {
} }
acceptedButtons: Qt.LeftButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.RightButton
anchors.fill: root.visibilities.isDrawing ? parent : undefined enabled: z > 0
hoverEnabled: true hoverEnabled: true
visible: root.visibilities.isDrawing visible: root.visibilities.isDrawing
onPositionChanged: event => { onPositionChanged: event => {
const x = event.x; const x = event.x;
const y = event.y; const y = event.y;
if (root.visibilities.isDrawing && (event.buttons & Qt.LeftButton)) { if (root.visibilities.isDrawing && (event.buttons & Qt.LeftButton)) {
root.drawing.points.push(Qt.point(x, y)); root.drawing.points.push(Qt.point(x, y));
root.drawing.requestPaint(); root.drawing.requestPaint();
} }
if (root.inLeftPanel(root.popout, x, y)) { if (root.inLeftPanel(root.popout, x, y)) {
console.log("set -2 z");
root.z = -2; root.z = -2;
root.panels.drawing.expanded = true; root.panels.drawing.expanded = true;
} }
+1 -1
View File
@@ -78,7 +78,7 @@ CustomMouseArea {
const dragY = y - dragStart.y; const dragY = y - dragStart.y;
if (root.visibilities.isDrawing && !root.inLeftPanel(root.panels.drawing, x, y)) { if (root.visibilities.isDrawing && !root.inLeftPanel(root.panels.drawing, x, y)) {
// root.input.z = 2; root.input.z = 2;
root.panels.drawing.expanded = false; root.panels.drawing.expanded = false;
} }
+4 -4
View File
@@ -309,12 +309,11 @@ Variants {
id: drawingLoader id: drawingLoader
active: visibilities.isDrawing active: visibilities.isDrawing
anchors.fill: parent
z: 2
sourceComponent: Drawing { sourceComponent: Drawing {
id: drawing id: drawing
anchors.fill: parent
z: 2
} }
} }
@@ -322,6 +321,8 @@ Variants {
id: inputLoader id: inputLoader
active: visibilities.isDrawing active: visibilities.isDrawing
anchors.fill: parent
z: 2
sourceComponent: DrawingInput { sourceComponent: DrawingInput {
id: input id: input
@@ -331,7 +332,6 @@ Variants {
panels: panels panels: panels
popout: panels.drawing popout: panels.drawing
visibilities: visibilities visibilities: visibilities
z: 2
} }
} }
-1
View File
@@ -48,7 +48,6 @@ Item {
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
asynchronous: true asynchronous: true
height: content.item.height
opacity: root.expanded ? 0 : 1 opacity: root.expanded ? 0 : 1
Behavior on opacity { Behavior on opacity {