use wrapperrectangle

This commit is contained in:
Benjamin Palko 2025-07-25 10:34:32 -04:00
parent 875551777c
commit 6027d0bbff

View file

@ -6,7 +6,7 @@ PopupWindow {
id: root
property bool opened: false
property int animationDuration: 200
property int margins: 10
property alias margins: background.margin
property alias backgroundColor: background.color
property alias radius: background.radius
required property Component content
@ -16,12 +16,9 @@ PopupWindow {
implicitWidth: background.width
implicitHeight: background.height
Rectangle {
WrapperRectangle {
id: background
implicitWidth: margins.width
implicitHeight: margins.height
opacity: 0
Behavior on opacity {
NumberAnimation {
@ -61,15 +58,9 @@ PopupWindow {
}
]
WrapperItem {
id: margins
margin: root.margins
Loader {
active: root.visible
sourceComponent: content
}
Loader {
active: root.visible
sourceComponent: content
}
}
}