mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 22:06:25 +00:00
05b6420f83
In some cases, when used inside Dialog and layout, tracer was located under other components and was therefore invisible.
61 lines
1.5 KiB
QML
61 lines
1.5 KiB
QML
import QtQuick 2.14
|
|
import QtQuick.Controls 2.14
|
|
import QtQuick.Layouts 1.14
|
|
|
|
Rectangle {
|
|
id: root
|
|
|
|
z: 1000
|
|
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
|
|
}
|
|
}
|
|
}
|