don't let the top panel scroll out of sight

This commit is contained in:
Marco Martin 2017-09-05 15:53:42 +02:00
parent 49cd27ec5f
commit ec8cf59ddb

View file

@ -137,7 +137,12 @@ FullScreenPanel {
when: !mainFlickable.moving && !mainFlickable.dragging && !mainFlickable.flicking
}
//no loop as those 2 values compute to exactly the same
onContentYChanged: window.offset = -contentY + contentArea.height - window.headerHeight
onContentYChanged: {
window.offset = -contentY + contentArea.height - window.headerHeight
if (contentY > contentArea.height - headerHeight) {
contentY = contentArea.height - headerHeight;
}
}
contentWidth: window.width
contentHeight: window.height*2
bottomMargin: window.height
@ -168,7 +173,7 @@ FullScreenPanel {
}
}
Rectangle {
height: units.gridUnit
height: units.smallSpacing
anchors {
left: parent.left
right: parent.right