fix drawing input anchoring incorrectly when using loader
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user