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
e21d716d
Commit
e21d716d
authored
May 05, 2014
by
Aleksi Suomalainen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12 from locusf/new_lockscreen
New lockscreen
parents
42a75b4d
9e3e2fb5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
97 deletions
+61
-97
Lockscreen.qml
src/qml/Lockscreen.qml
+1
-77
MainScreen.qml
src/qml/MainScreen.qml
+1
-18
compositor.qml
src/qml/compositor.qml
+59
-2
No files found.
src/qml/Lockscreen.qml
View file @
e21d716d
...
...
@@ -9,31 +9,9 @@ Image {
* the lockscreen is "down" (obscures the view) and 1 means the
* lockscreen is "up" (not visible).
**/
property
real
openingState
:
y
/
-
height
visible
:
openingState
<
1
onHeightChanged
:
{
if
(
mouseArea
.
fingerDown
)
return
// we'll fix this up on touch release via the animations
if
(
snapOpenAnimation
.
running
)
snapOpenAnimation
.
to
=
-
height
else
if
(
!
snapClosedAnimation
.
running
&&
!
LipstickSettings
.
lockscreenVisible
)
y
=
-
height
}
visible
:
LipstickSettings
.
lockscreenVisible
function
snapPosition
()
{
if
(
LipstickSettings
.
lockscreenVisible
)
{
snapOpenAnimation
.
stop
()
snapClosedAnimation
.
start
()
}
else
{
snapClosedAnimation
.
stop
()
snapOpenAnimation
.
start
()
}
}
function
cancelSnap
()
{
snapClosedAnimation
.
stop
()
snapOpenAnimation
.
stop
()
}
Connections
{
...
...
@@ -41,60 +19,6 @@ Image {
onLockscreenVisibleChanged
:
snapPosition
()
}
PropertyAnimation
{
id
:
snapClosedAnimation
target
:
lockScreen
property
:
"
y
"
to
:
0
easing.type
:
Easing
.
OutBounce
duration
:
400
}
PropertyAnimation
{
id
:
snapOpenAnimation
target
:
lockScreen
property
:
"
y
"
to
:
-
height
easing.type
:
Easing
.
OutExpo
duration
:
400
}
MouseArea
{
id
:
mouseArea
property
int
pressY
:
0
property
bool
fingerDown
property
bool
ignoreEvents
anchors.fill
:
parent
onPressed
:
{
fingerDown
=
true
cancelSnap
()
pressY
=
mouseY
}
onPositionChanged
:
{
var
delta
=
pressY
-
mouseY
pressY
=
mouseY
+
delta
if
(
parent
.
y
-
delta
>
0
)
return
parent
.
y
=
parent
.
y
-
delta
}
function
snapBack
()
{
fingerDown
=
false
if
(
!
LipstickSettings
.
lockscreenVisible
||
Math
.
abs
(
parent
.
y
)
>
parent
.
height
/
3
)
{
LipstickSettings
.
lockscreenVisible
=
false
}
else
if
(
LipstickSettings
.
lockscreenVisible
)
{
LipstickSettings
.
lockscreenVisible
=
true
}
lockScreen
.
snapPosition
()
}
onCanceled
:
snapBack
()
onReleased
:
snapBack
()
}
LockscreenClock
{
anchors
{
top
:
parent
.
top
...
...
src/qml/MainScreen.qml
View file @
e21d716d
...
...
@@ -54,7 +54,7 @@ Page {
defaultValue
:
"
images/graphics-wallpaper-home.jpg
"
}
id
:
desktop
property
alias
lockscreen
:
lockScreen
// Implements back key navigation
Keys.onReleased
:
{
if
(
event
.
key
===
Qt
.
Key_Back
)
{
...
...
@@ -131,9 +131,6 @@ Page {
Pager
{
id
:
pager
scale
:
0.7
+
0.3
*
lockScreen
.
openingState
opacity
:
lockScreen
.
openingState
anchors.fill
:
parent
model
:
VisualItemModel
{
...
...
@@ -162,20 +159,6 @@ Page {
width
:
parent
.
width
height
:
parent
.
height
z
:
200
onOpeningStateChanged
:
{
// When fully closed, reset the current page
if
(
openingState
!==
0
)
return
// Focus the switcher if any applications are running, otherwise the launcher
if
(
switcher
.
runningAppsCount
>
0
)
{
pager
.
currentIndex
=
2
}
else
{
pager
.
currentIndex
=
1
}
}
}
}
src/qml/compositor.qml
View file @
e21d716d
...
...
@@ -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