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
3d12c955
Commit
3d12c955
authored
Apr 23, 2014
by
Aleksi Suomalainen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[lock] Lock/unlock the screen from anywhere in the homescreen.
parent
3b6707c3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
13 deletions
+36
-13
MainScreen.qml
src/qml/MainScreen.qml
+15
-0
compositor.qml
src/qml/compositor.qml
+18
-12
resources-qml.qrc
src/resources-qml.qrc
+1
-0
src.pro
src/src.pro
+2
-1
No files found.
src/qml/MainScreen.qml
View file @
3d12c955
...
...
@@ -37,6 +37,7 @@ import QtQuick.Window 2.1
import
org
.
nemomobile
.
time
1.0
import
org
.
nemomobile
.
configuration
1.0
import
org
.
freedesktop
.
contextkit
1.0
import
"
scripts/desktop.js
"
as
Desktop
Page
{
...
...
@@ -112,6 +113,20 @@ Page {
font.pointSize
:
8
}
}
Component.onCompleted
:
{
Desktop
.
instance
=
desktop
}
function
lockscreenVisible
()
{
return
LipstickSettings
.
lockscreenVisible
===
true
}
function
setLockScreen
(
enabled
)
{
if
(
enabled
)
{
LipstickSettings
.
lockScreen
(
true
)
}
else
{
LipstickSettings
.
lockscreenVisible
=
false
}
}
Pager
{
id
:
pager
...
...
src/qml/compositor.qml
View file @
3d12c955
...
...
@@ -25,6 +25,7 @@ import QtQuick 2.0
import
org
.
nemomobile
.
lipstick
0.1
import
"
compositor
"
import
"
scripts/desktop.js
"
as
Desktop
Compositor
{
id
:
root
...
...
@@ -118,7 +119,7 @@ Compositor {
id
:
gestureArea
z
:
2
anchors.fill
:
parent
enabled
:
root
.
appActive
property
real
swipeThreshold
:
0.15
...
...
@@ -129,12 +130,23 @@ Compositor {
}
onGestureFinished
:
{
if
(
root
.
appActive
)
{
if
(
gestureArea
.
progress
>=
swipeThreshold
)
{
swipeAnimation
.
valueTo
=
inverted
?
-
max
:
max
swipeAnimation
.
start
()
}
else
{
cancelAnimation
.
start
()
}
}
else
if
(
root
.
homeActive
){
if
(
gestureArea
.
progress
>=
swipeThreshold
)
{
// Locks or unlocks depending if the screen is locked.
if
(
!
Desktop
.
instance
.
lockscreenVisible
())
{
Desktop
.
instance
.
setLockScreen
(
true
)
}
else
{
Desktop
.
instance
.
setLockScreen
(
false
)
}
}
}
}
states
:
[
...
...
@@ -151,12 +163,6 @@ Compositor {
x
:
gestureArea
.
horizontal
?
gestureArea
.
value
:
0
y
:
gestureArea
.
horizontal
?
0
:
gestureArea
.
value
}
PropertyChanges
{
target
:
homeLayer
opacity
:
0.6
+
0.4
*
gestureArea
.
progress
scale
:
0.8
+
0.2
*
gestureArea
.
progress
}
}
]
...
...
src/resources-qml.qrc
View file @
3d12c955
...
...
@@ -34,5 +34,6 @@
<file>qml/theme/icon-m-framework-close-thumbnail.png</file>
<file>qml/NotificationPreview.qml</file>
<file>qml/images/notification-circle.png</file>
<file>qml/scripts/desktop.js</file>
</qresource>
</RCC>
src/src.pro
View file @
3d12c955
...
...
@@ -41,6 +41,7 @@ OTHER_FILES += qml/*.qml \
qml/compositor/WindowWrapperBase.qml \
qml/compositor/WindowWrapperAlpha.qml \
qml/compositor/ScreenGestureArea.qml \
qml/NotificationPreview.qml
qml/NotificationPreview.qml \
qml/scripts/desktop.js
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