mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-01 08:52:45 +00:00
Snap NarrowHeader cover to either big or small
This commit is contained in:
parent
c1b0bddd10
commit
8552e08a12
1 changed files with 25 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue