mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
homescreens/folio: Allow overscroll from swipe from top of app drawer
This commit is contained in:
parent
7b977ec2e8
commit
b1ff9978c1
1 changed files with 9 additions and 3 deletions
|
|
@ -53,14 +53,20 @@ MobileShell.GridView {
|
|||
}
|
||||
|
||||
function onAppDrawerGridYChanged(y) {
|
||||
const maxContentY = Math.max(0, root.contentHeight - root.height);
|
||||
const minContentY = 0;
|
||||
root.contentY = Math.min(maxContentY, Math.max(minContentY, root.contentY - y));
|
||||
const maxContentY = Math.max(0, root.contentHeight - root.height);
|
||||
let contentY = Math.max(minContentY, root.contentY - y);
|
||||
|
||||
if (root.contentHeight < root.height) {
|
||||
// prevent overscroll only if contents are smaller than the view
|
||||
contentY = Math.min(maxContentY, contentY);
|
||||
}
|
||||
|
||||
root.contentY = contentY;
|
||||
velocityCalculator.changePosition(root.contentY);
|
||||
}
|
||||
|
||||
function onAppDrawerGridFlickRequested() {
|
||||
root.returnToBounds();
|
||||
root.flick(0, -velocityCalculator.velocity);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue