Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Mobile
Commits
ad21b85b
Commit
ad21b85b
authored
Feb 17, 2021
by
Devin Lin
🎨
Committed by
Bhushan Shah
Feb 22, 2021
Browse files
Cancel sliding panel animations on touch so it's more responsive
(cherry picked from commit
f231b04b
)
parent
3e2cef73
Changes
2
Hide whitespace changes
Inline
Side-by-side
containments/panel/package/contents/ui/SlidingPanel.qml
View file @
ad21b85b
...
...
@@ -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
;
...
...
containments/panel/package/contents/ui/main.qml
View file @
ad21b85b
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment