mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2024-11-22 09:15: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
|
width: parent.width
|
||||||
//spacing: Theme.paddingLarge
|
//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 {
|
MouseArea {
|
||||||
anchors.fill: albumArtImage
|
anchors.fill: albumArtImage
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
Loading…
Reference in a new issue