From d92e5b4cd70d89ed6de333926a6bdc019ff8129b Mon Sep 17 00:00:00 2001 From: zach Date: Wed, 27 May 2026 12:03:06 +0200 Subject: [PATCH] fix drawing input anchoring incorrectly when using loader --- Drawers/DrawingInput.qml | 4 ++-- Drawers/Interactions.qml | 2 +- Drawers/Windows.qml | 8 ++++---- Modules/Drawing/Wrapper.qml | 1 - 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Drawers/DrawingInput.qml b/Drawers/DrawingInput.qml index 0851a66..a8bec26 100644 --- a/Drawers/DrawingInput.qml +++ b/Drawers/DrawingInput.qml @@ -22,20 +22,20 @@ CustomMouseArea { } acceptedButtons: Qt.LeftButton | Qt.RightButton - anchors.fill: root.visibilities.isDrawing ? parent : undefined + enabled: z > 0 hoverEnabled: true visible: root.visibilities.isDrawing onPositionChanged: event => { const x = event.x; const y = event.y; - if (root.visibilities.isDrawing && (event.buttons & Qt.LeftButton)) { root.drawing.points.push(Qt.point(x, y)); root.drawing.requestPaint(); } if (root.inLeftPanel(root.popout, x, y)) { + console.log("set -2 z"); root.z = -2; root.panels.drawing.expanded = true; } diff --git a/Drawers/Interactions.qml b/Drawers/Interactions.qml index f7fcdf0..7ba6670 100644 --- a/Drawers/Interactions.qml +++ b/Drawers/Interactions.qml @@ -78,7 +78,7 @@ CustomMouseArea { const dragY = y - dragStart.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; } diff --git a/Drawers/Windows.qml b/Drawers/Windows.qml index eac6f5f..d45b2cb 100644 --- a/Drawers/Windows.qml +++ b/Drawers/Windows.qml @@ -309,12 +309,11 @@ Variants { id: drawingLoader active: visibilities.isDrawing + anchors.fill: parent + z: 2 sourceComponent: Drawing { id: drawing - - anchors.fill: parent - z: 2 } } @@ -322,6 +321,8 @@ Variants { id: inputLoader active: visibilities.isDrawing + anchors.fill: parent + z: 2 sourceComponent: DrawingInput { id: input @@ -331,7 +332,6 @@ Variants { panels: panels popout: panels.drawing visibilities: visibilities - z: 2 } } diff --git a/Modules/Drawing/Wrapper.qml b/Modules/Drawing/Wrapper.qml index 6ff4da4..6376d30 100644 --- a/Modules/Drawing/Wrapper.qml +++ b/Modules/Drawing/Wrapper.qml @@ -48,7 +48,6 @@ Item { anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter asynchronous: true - height: content.item.height opacity: root.expanded ? 0 : 1 Behavior on opacity {