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 @@ -263,14 +263,25 @@ scrollView.flickableItem.contentY = pos.y; } + QtObject { + id: privateObject + + readonly property var bottomMargin: { + if (contentItem.implicitHeight >= (3/4)*outerFlickable.height) { + return 0 + } + return Units.gridUnit*2 + } + } + ParallelAnimation { id: openAnimation property int margins: Units.gridUnit * 5 NumberAnimation { target: outerFlickable properties: "contentY" from: -outerFlickable.height - to: Math.max(0, outerFlickable.height - outerFlickable.contentHeight + headerItem.height + footerItem.height) + to: Math.max(0, outerFlickable.height - outerFlickable.contentHeight + headerItem.height + footerItem.height) + privateObject.bottomMargin duration: Units.longDuration easing.type: Easing.OutQuad } @@ -288,9 +299,9 @@ target: outerFlickable properties: "contentY" from: outerFlickable.contentY - to: outerFlickable.visibleArea.yPosition < (1 - outerFlickable.visibleArea.heightRatio)/2 || scrollView.flickableItem.contentHeight < outerFlickable.height + to: (outerFlickable.visibleArea.yPosition < (1 - outerFlickable.visibleArea.heightRatio)/2 || scrollView.flickableItem.contentHeight < outerFlickable.height ? Math.max(0, outerFlickable.height - outerFlickable.contentHeight + headerItem.height + footerItem.height) - : outerFlickable.contentHeight - outerFlickable.height + outerFlickable.topEmptyArea + headerItem.height + footerItem.height + : outerFlickable.contentHeight - outerFlickable.height + outerFlickable.topEmptyArea + headerItem.height + footerItem.height) + privateObject.bottomMargin duration: Units.longDuration easing.type: Easing.OutQuad }