Commit 44bafbed authored by Marco Martin's avatar Marco Martin

simplify scroll snapping

parent f5f78c1b
......@@ -156,48 +156,6 @@ Item {
summary: "July: Hello?"
actions: []
}
ListElement {
source: "im2Source"
appIcon: "im-google"
appName: "Message"
summary: "July: Hello?"
actions: []
}
ListElement {
source: "im2Source"
appIcon: "im-google"
appName: "Message"
summary: "July: Hello?"
actions: []
}
ListElement {
source: "im2Source"
appIcon: "im-google"
appName: "Message"
summary: "July: Hello?"
actions: []
}
ListElement {
source: "im2Source"
appIcon: "im-google"
appName: "Message"
summary: "July: Hello?"
actions: []
}
ListElement {
source: "im2Source"
appIcon: "im-google"
appName: "Message"
summary: "July: Hello?"
actions: []
}
ListElement {
source: "im2Source"
appIcon: "im-google"
appName: "Message"
summary: "July: Hello?"
actions: []
}
}
ListView {
......
......@@ -515,10 +515,7 @@ Item {
snapMode: GridView.SnapToRow
onFlickingChanged: {
if (!draggingVertically && contentY < -headerItem.height + root.height) {
scrollAnim.to = Math.round(contentY/root.height) * root.height
scrollAnim.running = true;
}
draggingVerticallyChanged(false);
}
onDraggingVerticallyChanged: {
if (draggingVertically) {
......@@ -540,13 +537,6 @@ Item {
scrollAnim.running = true;
return;
}
//(1000/scrollAnim.duration) is the length scrolled at the current speed in the duration of the animation
if (contentY < -headerItem.height + root.height) {
scrollAnim.to = Math.round((contentY + (verticalVelocity / (1000/scrollAnim.duration))) / root.height) * root.height
scrollAnim.running = true;
}
}
NumberAnimation {
id: scrollAnim
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment