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