From 4f3a6b46d36db754dfa25183d3aefb7566a99b5c Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 13 Jul 2022 10:28:54 -0400 Subject: [PATCH] fix(AppMain): put dropRectangle in a Loader, active when dragging Fixes #6023 --- ui/app/mainui/AppMain.qml | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/ui/app/mainui/AppMain.qml b/ui/app/mainui/AppMain.qml index f4a0c15a3d..6add4d27e5 100644 --- a/ui/app/mainui/AppMain.qml +++ b/ui/app/mainui/AppMain.qml @@ -811,24 +811,17 @@ Item { rptDraggedPreviews.y = drag.y } onExited: cleanup() - Rectangle { - id: dropRectangle - - width: parent.width - height: parent.height - color: Style.current.transparent - opacity: 0.8 - - states: [ - State { - when: dragTarget.enabled && dragTarget.containsDrag - PropertyChanges { - target: dropRectangle - color: Style.current.background - } - } - ] + Loader { + active: dragTarget.enabled && dragTarget.containsDrag + width: active ? parent.width : 0 + height: active ? parent.height : 0 + sourceComponent: Rectangle { + id: dropRectangle + color: Style.current.background + opacity: 0.8 + } } + Repeater { id: rptDraggedPreviews