2022-08-10 14:47:37 +00:00
|
|
|
import QtQuick 2.14
|
2022-10-06 12:04:14 +00:00
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
2022-08-10 14:47:37 +00:00
|
|
|
|
|
|
|
Rectangle {
|
2022-10-06 12:04:14 +00:00
|
|
|
id: root
|
|
|
|
|
2023-01-31 23:15:50 +00:00
|
|
|
z: 1000
|
2022-10-06 12:04:14 +00:00
|
|
|
border.color: 'red'
|
|
|
|
color: 'transparent'
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: internal
|
|
|
|
|
|
|
|
property Item originalParent
|
|
|
|
property int counter: 0
|
|
|
|
|
|
|
|
PropertyAnimation on counter {
|
|
|
|
id: positionUpdater
|
|
|
|
|
|
|
|
running: false
|
|
|
|
from: 0
|
|
|
|
to: 1000
|
|
|
|
duration: 1000
|
|
|
|
loops: Animation.Infinite
|
|
|
|
}
|
|
|
|
|
|
|
|
onCounterChanged: {
|
|
|
|
const overlay = originalParent.Overlay.overlay
|
|
|
|
|
|
|
|
if (!overlay)
|
|
|
|
return
|
|
|
|
|
|
|
|
root.parent = overlay
|
|
|
|
root.visible = originalParent.visible
|
|
|
|
const rect = originalParent.mapToItem(
|
|
|
|
overlay, 0, 0, originalParent.width, originalParent.height)
|
|
|
|
root.x = rect.x
|
|
|
|
root.y = rect.y
|
|
|
|
root.width = rect.width
|
|
|
|
root.height = rect.height
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
if (parent instanceof ColumnLayout
|
|
|
|
|| parent instanceof RowLayout
|
|
|
|
|| parent instanceof GridLayout
|
|
|
|
|| parent instanceof Column
|
|
|
|
|| parent instanceof Row
|
|
|
|
|| parent instanceof Grid
|
|
|
|
|| parent instanceof Flow) {
|
|
|
|
internal.originalParent = parent
|
|
|
|
positionUpdater.running = true
|
|
|
|
} else {
|
|
|
|
if (!anchors.fill)
|
|
|
|
anchors.fill = parent
|
|
|
|
}
|
|
|
|
}
|
2022-08-10 14:47:37 +00:00
|
|
|
}
|