mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-04 10:44:46 +00:00
better behavior of the lock/unlock swipe
This commit is contained in:
parent
151bdc6d15
commit
356743116b
1 changed files with 33 additions and 13 deletions
|
|
@ -477,6 +477,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
property var dragData
|
property var dragData
|
||||||
|
property bool wasLocked: true
|
||||||
|
|
||||||
cellWidth: root.width / 4
|
cellWidth: root.width / 4
|
||||||
cellHeight: root.buttonHeight
|
cellHeight: root.buttonHeight
|
||||||
|
|
@ -491,21 +492,40 @@ Item {
|
||||||
if (draggingVertically) {
|
if (draggingVertically) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
print("AAAAAA "+contentY+" "+(-headerItem.height + root.height)+" "+(-headerItem.height + root.height/5)+wasLocked)
|
||||||
|
|
||||||
//manage separately the first page, the lockscreen
|
if (wasLocked) {
|
||||||
//scrolling down
|
//scrolling down, unlock
|
||||||
if (verticalVelocity > 0 && contentY < -headerItem.height + root.height &&
|
if (contentY > (-headerItem.height + root.height/5)) {
|
||||||
contentY > (-headerItem.height + root.height/6)) {
|
scrollAnim.to = -headerItem.height +plasmoid.availableScreenRect.height
|
||||||
scrollAnim.to = -headerItem.height +plasmoid.availableScreenRect.height
|
scrollAnim.running = true;
|
||||||
scrollAnim.running = true;
|
wasLocked = false;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//scrolling up
|
//scrolling up, lock
|
||||||
} else if (verticalVelocity < 0 && contentY < -headerItem.height + root.height &&
|
} else {
|
||||||
contentY < (-headerItem.height + root.height/6*5)) {
|
scrollAnim.to = -headerItem.height;
|
||||||
scrollAnim.to = -headerItem.height;
|
scrollAnim.running = true;
|
||||||
scrollAnim.running = true;
|
wasLocked = true;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//was unlocked
|
||||||
|
} else {
|
||||||
|
//scrolling up, lock
|
||||||
|
if (contentY < (-headerItem.height + root.height - root.height/5)) {
|
||||||
|
scrollAnim.to = -headerItem.height;
|
||||||
|
scrollAnim.running = true;
|
||||||
|
wasLocked = true;
|
||||||
|
return;
|
||||||
|
|
||||||
|
//scrolling down, unlock
|
||||||
|
} else if (contentY < (-headerItem.height + root.height + root.height/5)) {
|
||||||
|
scrollAnim.to = -headerItem.height +plasmoid.availableScreenRect.height
|
||||||
|
scrollAnim.running = true;
|
||||||
|
wasLocked = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue