Commit ad21b85b authored by Devin Lin's avatar Devin Lin 🎨 Committed by Bhushan Shah
Browse files

Cancel sliding panel animations on touch so it's more responsive



(cherry picked from commit f231b04b)
parent 3e2cef73
......@@ -52,14 +52,21 @@ NanoShell.FullScreenOverlay {
}
property int direction: SlidingPanel.MovementDirection.None
function cancelAnimations() {
closeAnim.stop();
openAnim.stop();
}
function open() {
cancelAnimations();
window.showFullScreen();
openAnim.restart();
}
function close() {
cancelAnimations();
closeAnim.restart();
}
function updateState() {
cancelAnimations();
if (window.direction === SlidingPanel.MovementDirection.None) {
if (offset < openThreshold) {
close();
......@@ -194,7 +201,10 @@ NanoShell.FullScreenOverlay {
contentWidth: window.width
contentHeight: window.height*2
bottomMargin: window.height
onMovementStarted: window.userInteracting = true;
onMovementStarted: {
window.cancelAnimations();
window.userInteracting = true;
}
onFlickStarted: window.userInteracting = true;
onMovementEnded: {
window.userInteracting = false;
......
......@@ -265,6 +265,7 @@ Item {
anchors.fill: parent
onPressed: {
slidingPanel.cancelAnimations();
slidingPanel.drawerX = Math.min(Math.max(0, mouse.x - slidingPanel.drawerWidth/2), slidingPanel.width - slidingPanel.drawerWidth)
slidingPanel.userInteracting = true;
oldMouseY = mouse.y;
......
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