mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2024-12-22 14:05:18 +00:00
Snap NarrowHeader cover to either big or small
This commit is contained in:
parent
c1b0bddd10
commit
8552e08a12
|
@ -43,6 +43,31 @@ Item {
|
|||
width: parent.width
|
||||
//spacing: Theme.paddingLarge
|
||||
|
||||
Connections {
|
||||
target: listview
|
||||
onVerticalVelocityChanged: {
|
||||
if (!listview.draggingVertically && Math.abs(listview.verticalVelocity) < Theme.itemSizeMedium
|
||||
&& listview.contentY < -smallSize) {
|
||||
if (listview.verticalVelocity > 0) {
|
||||
listview.cancelFlick()
|
||||
listviewShrinkAnimation.start()
|
||||
} else if (listview.verticalVelocity < 0){
|
||||
listview.cancelFlick()
|
||||
listviewGrowAnimation.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
onDraggingVerticallyChanged: {
|
||||
if (!listview.draggingVertically && listview.verticalVelocity == 0) {
|
||||
if (-smallSize - listview.contentY > -bigSize - listview.contentY) {
|
||||
listviewShrinkAnimation.start()
|
||||
} else {
|
||||
listviewGrowAnimation.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: albumArtImage
|
||||
onClicked: {
|
||||
|
|
Loading…
Reference in a new issue