diff --git a/src/controls/templates/OverlaySheet.qml b/src/controls/templates/OverlaySheet.qml --- a/src/controls/templates/OverlaySheet.qml +++ b/src/controls/templates/OverlaySheet.qml @@ -145,11 +145,12 @@ Qt.inputMethod.hide(); } } - onWidthChanged: { + + readonly property real contentWidth: Math.max(root.width/2, Math.min(root.width, root.contentItem.implicitWidth)) + onContentWidthChanged: { if (!contentItem.contentItem) return - var width = Math.max(root.width/2, Math.min(root.width, root.contentItem.implicitWidth)); contentItem.contentItem.x = (root.width - width)/2 contentItem.contentItem.width = width; } @@ -207,13 +208,6 @@ to: topOpenPosition duration: Units.longDuration easing.type: Easing.OutQuad - onRunningChanged: { - if (!running) { - var width = Math.max(root.width/2, Math.min(root.width, root.contentItem.implicitWidth)); - contentItem.contentItem.x = (root.width - width)/2 - contentItem.contentItem.width = width; - } - } } SequentialAnimation {