diff --git a/src/controls/templates/ApplicationHeader.qml b/src/controls/templates/ApplicationHeader.qml --- a/src/controls/templates/ApplicationHeader.qml +++ b/src/controls/templates/ApplicationHeader.qml @@ -273,6 +273,11 @@ x: titleList.wideMode || headerStyle == ApplicationHeaderStyle.Titles ? (Math.min(delegate.width - implicitWidth, Math.max(0, titleList.contentX - delegate.x + navButtons.width))) : 0 width: parent.width - x + Connections { + target: delegateLoader.page + Component.onDestruction: delegateLoader.sourceComponent = null + } + sourceComponent: header.pageDelegate readonly property Page page: __appWindow.pageStack.get(modelData) diff --git a/src/controls/templates/OverlayDrawer.qml b/src/controls/templates/OverlayDrawer.qml --- a/src/controls/templates/OverlayDrawer.qml +++ b/src/controls/templates/OverlayDrawer.qml @@ -150,7 +150,7 @@ //try to take the last item if (!item) { - item = applicationWindow().pageStack.get(applicationWindow().pageStack.depth-1); + item = applicationWindow().pageStack.lastItem; } var pageFooter = item && item.page ? item.page.footer : (item ? item.footer : undefined); 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 @@ -314,7 +314,7 @@ z: 2 Item { id: headerParent - implicitHeight: header.implicitHeight + implicitHeight: header ? header.implicitHeight : 0 anchors { fill: parent margins: Units.smallSpacing @@ -352,7 +352,7 @@ z: 2 Item { id: footerParent - implicitHeight: footer.implicitHeight + implicitHeight: footer ? footer.implicitHeight : 0 anchors { fill: parent margins: Units.smallSpacing @@ -418,20 +418,17 @@ } Binding { - when: scrollView.verticalScrollBar != null - target: scrollView.verticalScrollBar.anchors + target: scrollView.verticalScrollBar ? scrollView.verticalScrollBar.anchors : null property: "topMargin" value: headerItem.y + headerItem.height } Binding { - when: scrollView.verticalScrollBar != null target: scrollView.verticalScrollBar property: "height" - value: mainItem.height - scrollView.verticalScrollBar.anchors.topMargin - (mainItem.height - footerItem.y) + value: mainItem.height - (scrollView.verticalScrollBar ? scrollView.verticalScrollBar.anchors.topMargin : 0) - (mainItem.height - footerItem.y) } Binding { - when: scrollView.verticalScrollBar != null - target: scrollView.verticalScrollBar.anchors + target: scrollView.verticalScrollBar ? scrollView.verticalScrollBar.anchors : null property: "rightMargin" value: mainItem.width - flickableContents.width - flickableContents.x }