Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
glacier-home
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NemoMobile
glacier-home
Commits
9e3e2fb5
Commit
9e3e2fb5
authored
Apr 27, 2014
by
Aleksi Suomalainen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[lockscreen] Introduce swiping lockscreen via compositor.
parent
9c7bb822
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
2 deletions
+59
-2
compositor.qml
src/qml/compositor.qml
+59
-2
No files found.
src/qml/compositor.qml
View file @
9e3e2fb5
...
...
@@ -122,11 +122,17 @@ Compositor {
property
real
swipeThreshold
:
0.15
property
real
lockThreshold
:
0.25
onGestureStarted
:
{
swipeAnimation
.
stop
()
cancelAnimation
.
stop
()
state
=
"
swipe
"
lockAnimation
.
stop
()
if
(
root
.
appActive
)
{
state
=
"
swipe
"
}
else
if
(
root
.
homeActive
)
{
state
=
"
lock
"
}
}
onGestureFinished
:
{
...
...
@@ -141,13 +147,19 @@ Compositor {
cancelAnimation
.
start
()
}
}
else
if
(
root
.
homeActive
){
if
(
gestureArea
.
progress
>=
swipeThreshold
)
{
if
(
gestureArea
.
progress
>=
lockThreshold
)
{
lockAnimation
.
valueTo
=
(
gestureArea
.
gesture
==
"
left
"
?
Desktop
.
instance
.
lockscreen
.
width
:
-
Desktop
.
instance
.
lockscreen
.
width
)
lockAnimation
.
start
()
// Locks or unlocks depending if the screen is locked.
if
(
!
Desktop
.
instance
.
lockscreenVisible
())
{
Desktop
.
instance
.
setLockScreen
(
true
)
}
else
{
Desktop
.
instance
.
setLockScreen
(
false
)
}
}
else
{
cancelAnimation
.
start
()
}
}
}
...
...
@@ -166,7 +178,30 @@ Compositor {
x
:
gestureArea
.
horizontal
?
gestureArea
.
value
:
0
y
:
gestureArea
.
horizontal
?
0
:
gestureArea
.
value
}
},
State
{
name
:
"
lock
"
PropertyChanges
{
target
:
Desktop
.
instance
.
lockscreen
visible
:
true
}
PropertyChanges
{
target
:
gestureArea
delayReset
:
true
}
PropertyChanges
{
target
:
Desktop
.
instance
.
lockscreen
x
:
gestureArea
.
horizontal
?
(
Desktop
.
instance
.
lockscreenVisible
()?(
gestureArea
.
value
):
(
gestureArea
.
gesture
==
"
right
"
?
-
Desktop
.
instance
.
lockscreen
.
width
+
Math
.
abs
(
gestureArea
.
value
)
:
Desktop
.
instance
.
lockscreen
.
width
+
gestureArea
.
value
)
)
:
0
y
:
gestureArea
.
horizontal
?
0
:
(
Desktop
.
instance
.
lockscreenVisible
()?(
gestureArea
.
value
):
(
gestureArea
.
gesture
==
"
down
"
?
-
Desktop
.
instance
.
lockscreen
.
height
+
Math
.
abs
(
gestureArea
.
value
)
:
Desktop
.
instance
.
lockscreen
.
height
+
gestureArea
.
value
)
)
}
}
]
SequentialAnimation
{
...
...
@@ -187,6 +222,28 @@ Compositor {
}
}
SequentialAnimation
{
id
:
lockAnimation
property
alias
valueTo
:
valueAnimationLock
.
to
SmoothedAnimation
{
id
:
valueAnimationLock
target
:
Desktop
.
instance
.
lockscreen
property
:
"
x
"
easing.type
:
Easing
.
OutQuint
}
ScriptAction
{
script
:
Desktop
.
instance
.
setLockScreen
(
Desktop
.
instance
.
lockscreenVisible
())
}
PropertyAction
{
target
:
gestureArea
property
:
"
state
"
value
:
""
}
}
SequentialAnimation
{
id
:
swipeAnimation
...
...
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