mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-28 14:43:09 +00:00
simplify scroll snapping
This commit is contained in:
parent
f5f78c1baa
commit
44bafbed70
2 changed files with 1 additions and 53 deletions
|
|
@ -156,48 +156,6 @@ Item {
|
||||||
summary: "July: Hello?"
|
summary: "July: Hello?"
|
||||||
actions: []
|
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 {
|
ListView {
|
||||||
|
|
|
||||||
|
|
@ -515,10 +515,7 @@ Item {
|
||||||
snapMode: GridView.SnapToRow
|
snapMode: GridView.SnapToRow
|
||||||
|
|
||||||
onFlickingChanged: {
|
onFlickingChanged: {
|
||||||
if (!draggingVertically && contentY < -headerItem.height + root.height) {
|
draggingVerticallyChanged(false);
|
||||||
scrollAnim.to = Math.round(contentY/root.height) * root.height
|
|
||||||
scrollAnim.running = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
onDraggingVerticallyChanged: {
|
onDraggingVerticallyChanged: {
|
||||||
if (draggingVertically) {
|
if (draggingVertically) {
|
||||||
|
|
@ -540,13 +537,6 @@ Item {
|
||||||
scrollAnim.running = true;
|
scrollAnim.running = true;
|
||||||
return;
|
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 {
|
NumberAnimation {
|
||||||
id: scrollAnim
|
id: scrollAnim
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue