fix(AppMain): put dropRectangle in a Loader, active when dragging

Fixes #6023
This commit is contained in:
Jonathan Rainville 2022-07-13 10:28:54 -04:00
parent 8433ed9545
commit 4f3a6b46d3
1 changed files with 10 additions and 17 deletions

View File

@ -811,24 +811,17 @@ Item {
rptDraggedPreviews.y = drag.y rptDraggedPreviews.y = drag.y
} }
onExited: cleanup() onExited: cleanup()
Rectangle { Loader {
active: dragTarget.enabled && dragTarget.containsDrag
width: active ? parent.width : 0
height: active ? parent.height : 0
sourceComponent: Rectangle {
id: dropRectangle 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 color: Style.current.background
opacity: 0.8
} }
} }
]
}
Repeater { Repeater {
id: rptDraggedPreviews id: rptDraggedPreviews