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
7020765f
Commit
7020765f
authored
Oct 19, 2017
by
m2ko
Committed by
eekkelund
Apr 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Lockscreen] WIP broken lockscreen
parent
b5e42866
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
152 additions
and
61 deletions
+152
-61
main.cpp
src/main.cpp
+1
-0
DeviceLockUI.qml
src/qml/DeviceLockUI.qml
+43
-1
Lockscreen.qml
src/qml/Lockscreen.qml
+27
-43
MainScreen.qml
src/qml/MainScreen.qml
+4
-11
compositor.qml
src/qml/compositor.qml
+72
-1
compositor_new.qml
src/qml/compositor_new.qml
+5
-5
No files found.
src/main.cpp
View file @
7020765f
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include "glacierwindowmodel.h"
#include "glacierwindowmodel.h"
#include <QScreen>
#include <QScreen>
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
HomeApplication
app
(
argc
,
argv
,
QString
());
HomeApplication
app
(
argc
,
argv
,
QString
());
...
...
src/qml/DeviceLockUI.qml
View file @
7020765f
...
@@ -16,6 +16,44 @@ Item {
...
@@ -16,6 +16,44 @@ Item {
property
bool
shouldAuthenticate
:
Lipstick
.
compositor
.
visible
property
bool
shouldAuthenticate
:
Lipstick
.
compositor
.
visible
property
int
remainingAttempts
property
int
remainingAttempts
property
AuthenticationInput
authenticationInput
property
AuthenticationInput
authenticationInput
signal
codeEntered
(
string
code
)
onShouldAuthenticateChanged
:
{
if
(
shouldAuthenticate
)
{
console
.
log
(
"
Requesting security code
"
+
JSON
.
stringify
(
authenticationInput
))
}
else
{
authenticator
.
cancel
()
DeviceLock
.
authorization
.
relinquishChallenge
()
}
}
/*Component.onCompleted: {
console.log("Requesting security code "+ authenticationInput.Status)
authenticationInput.requestSecurityCode()
}*/
/*Connections {
target: DeviceLock.authorization
onChallengeIssued: {
authenticator.authenticate(
DeviceLock.authorization.challengeCode,
DeviceLock.authorization.allowedMethods)
}
}*/
/*authenticationInput.onAuthenticationUnavailable: {
console.log("Authentication unavailable: "+error)
}
authenticationInput.onFeedback: {
console.log("Feedback: "+feedback)
}
authenticationInput.onAuthenticationStarted: {
console.log("Authentication started")
}
authenticationInput.onAuthenticationEnded: {
console.log("Ended "+confirmed)
}*/
ColumnLayout
{
ColumnLayout
{
anchors.fill
:
parent
anchors.fill
:
parent
...
@@ -80,10 +118,15 @@ Item {
...
@@ -80,10 +118,15 @@ Item {
feedbackLabel
.
text
=
"
"
feedbackLabel
.
text
=
"
"
attemptsRemainingLabel
.
text
=
"
"
attemptsRemainingLabel
.
text
=
"
"
if
(
numLabel
.
text
!==
"
Ca
"
&&
numLabel
.
text
!==
"
OK
"
)
{
if
(
numLabel
.
text
!==
"
Ca
"
&&
numLabel
.
text
!==
"
OK
"
)
{
console
.
log
(
authenticationInput
.
Status
)
lockCodeField
.
insert
(
lockCodeField
.
cursorPosition
,
numLabel
.
text
)
lockCodeField
.
insert
(
lockCodeField
.
cursorPosition
,
numLabel
.
text
)
authenticationInput
.
requestSecurityCode
()
}
else
{
}
else
{
if
(
numLabel
.
text
===
"
OK
"
)
{
if
(
numLabel
.
text
===
"
OK
"
)
{
console
.
log
(
"
DeviceLockUI:
"
+
JSON
.
stringify
(
authenticationInput
))
//auth.authenticate(Authorization.challengeCode, auth.availableMethods)
authenticationInput
.
enterSecurityCode
(
lockCodeField
.
text
)
authenticationInput
.
enterSecurityCode
(
lockCodeField
.
text
)
//codeEntered(lockCodeField.text)
lockCodeField
.
text
=
""
lockCodeField
.
text
=
""
}
else
if
(
numLabel
.
text
===
"
Ca
"
){
}
else
if
(
numLabel
.
text
===
"
Ca
"
){
lockCodeField
.
text
=
""
lockCodeField
.
text
=
""
...
@@ -95,7 +138,6 @@ Item {
...
@@ -95,7 +138,6 @@ Item {
}
}
}
}
function
displayFeedback
(
feedback
,
data
)
{
function
displayFeedback
(
feedback
,
data
)
{
switch
(
feedback
)
{
switch
(
feedback
)
{
case
AuthenticationInput.EnterSecurityCode
:
case
AuthenticationInput.EnterSecurityCode
:
...
...
src/qml/Lockscreen.qml
View file @
7020765f
...
@@ -56,7 +56,7 @@ Image {
...
@@ -56,7 +56,7 @@ Image {
startX
=
mouseX
;
startX
=
mouseX
;
}
}
onMouseXChanged
:
{
onMouseXChanged
:
{
// Checks which
was it left or right
swipe
// Checks which swipe
if
(
mouseX
>
(
startX
+
threshold
))
{
if
(
mouseX
>
(
startX
+
threshold
))
{
gesture
=
"
right
"
gesture
=
"
right
"
gestureStarted
=
true
;
gestureStarted
=
true
;
...
@@ -88,9 +88,9 @@ Image {
...
@@ -88,9 +88,9 @@ Image {
}
}
}
}
// Animation to snap codepad into view or out of view
// Animation to sna codepad into view or out of view
onReleased
:
{
onReleased
:
{
displayOffTimer
.
restart
()
if
(
codePad
.
inView
)
{
if
(
codePad
.
inView
)
{
if
(
gesture
==
"
right
"
)
{
if
(
gesture
==
"
right
"
)
{
if
(
swipeDistance
>
threshold
)
{
if
(
swipeDistance
>
threshold
)
{
...
@@ -146,24 +146,6 @@ Image {
...
@@ -146,24 +146,6 @@ Image {
easing.type
:
Easing
.
OutQuint
easing.type
:
Easing
.
OutQuint
}
}
}
}
SequentialAnimation
{
id
:
unlockAnimation
property
alias
valueTo
:
unlockNumAnimation
.
to
property
alias
setProperty
:
unlockNumAnimation
.
property
NumberAnimation
{
id
:
unlockNumAnimation
target
:
lockScreen
property
:
"
y
"
to
:
-
height
duration
:
250
easing.type
:
Easing
.
OutQuint
}
onStopped
:
{
setLockScreen
(
false
)
}
}
Connections
{
Connections
{
target
:
Lipstick
.
compositor
target
:
Lipstick
.
compositor
...
@@ -206,47 +188,49 @@ Image {
...
@@ -206,47 +188,49 @@ Image {
id
:
codePad
id
:
codePad
property
bool
inView
:
false
property
bool
inView
:
false
property
bool
gestureStarted
:
mouseArea
.
gestureStarted
property
bool
gestureStarted
:
mouseArea
.
gestureStarted
x
:
1000
x
:
width
*
2
visible
:
DeviceLock
.
state
==
DeviceLock
.
Locked
&&
lockscreenVisible
()
visible
:
DeviceLock
.
state
==
DeviceLock
.
Locked
&&
lockscreenVisible
()
width
:
lockScreen
.
width
width
:
lockScreen
.
width
height
:
lockScreen
.
height
/
2
height
:
lockScreen
.
height
/
2
opacity
:
(
1
-
Math
.
abs
((
1
-
(
-
1
))
*
(
x
-
(
-
parent
.
width
))
/
(
parent
.
width
-
(
-
parent
.
width
))
+
(
-
1
)))
onCodeEntered
:
{
//authenticationInput.enterSecurityCode(code)
console
.
log
(
"
Security code entered:
"
+
authenticationInput
.
minimumCodeLength
)
}
authenticationInput
:
DeviceLockAuthenticationInput
{
authenticationInput
:
DeviceLockAuthenticationInput
{
//property bool unlocked: DeviceLock.state >= DeviceLock.Locked
readonly
property
bool
unlocking
:
registered
readonly
property
bool
unlocking
:
registered
&&
DeviceLock
.
state
>=
DeviceLock
.
Locked
&&
DeviceLock
.
state
<
DeviceLock
.
Undefined
&&
DeviceLock
.
state
>=
DeviceLock
.
Locked
&&
DeviceLock
.
state
<
DeviceLock
.
Undefined
registered
:
lockscreenVisible
()
registered
:
true
active
:
lockscreenVisible
()
active
:
true
//active: lockscreenVisible()
// onUnlockedChanged: console.log("Unlock")
onStatusChanged
:
{
console
.
log
(
"
Status changed
"
)
}
onUnlockingChanged
:
{
onUnlockingChanged
:
{
console
.
log
(
"
Unlock
"
)
if
(
unlocking
)
{
if
(
unlocking
)
{
DeviceLock
.
unlock
()
DeviceLock
.
unlock
()
}
else
{
}
else
{
DeviceLock
.
cancel
()
DeviceLock
.
cancel
()
}
}
}
}
onAuthenticationEnded
:
{
onAuthenticationUnavailable
:
{
if
(
confirmed
)
{
console
.
log
(
"
Authentication unavailable:
"
+
error
)
unlockAnimationHelper
(
mouseArea
.
gesture
)
}
}
else
{
}
onFeedback
:
{
console
.
log
(
"
Feedback:
"
+
feedback
)
}
onAuthenticationStarted
:
{
console
.
log
(
"
Authentication started
"
)
}
}
function
unlockAnimationHelper
(
gesture
)
{
onAuthenticationEnded
:
{
if
(
gesture
==
"
left
"
)
{
console
.
log
(
"
Ended
"
+
confirmed
)
unlockAnimation
.
setProperty
=
"
x
"
unlockAnimation
.
valueTo
=
-
width
unlockAnimation
.
start
()
}
if
(
gesture
==
"
right
"
)
{
unlockAnimation
.
setProperty
=
"
x
"
unlockAnimation
.
valueTo
=
width
unlockAnimation
.
start
()
}
}
}
}
}
...
...
src/qml/MainScreen.qml
View file @
7020765f
...
@@ -67,6 +67,7 @@ Page {
...
@@ -67,6 +67,7 @@ Page {
property
alias
lockscreen
:
lockScreen
property
alias
lockscreen
:
lockScreen
property
alias
switcher
:
switcher
property
alias
switcher
:
switcher
//property alias codepad: codePad
property
int
statusBarHeight
:
statusbar
.
height
property
int
statusBarHeight
:
statusbar
.
height
property
bool
codepadVisible
:
false
property
bool
codepadVisible
:
false
property
bool
deviceLocked
:
DeviceLock
.
state
>=
DeviceLock
.
Locked
property
bool
deviceLocked
:
DeviceLock
.
state
>=
DeviceLock
.
Locked
...
@@ -169,20 +170,12 @@ Page {
...
@@ -169,20 +170,12 @@ Page {
width
:
parent
.
width
width
:
parent
.
width
height
:
parent
.
height
height
:
parent
.
height
z
:
200
z
:
200
Item
{
/*
Item {
id: codePad
id: codePad
visible: false
visible: false
}
}
*/
/*DeviceLockUI {
/*DeviceLockUI {
id: codePad
id:codePad
visible: DeviceLock.state == DeviceLock.Locked && codepadVisible
width: lockScreen.width
height:lockScreen.height / 2
anchors {
verticalCenter: lockScreen.verticalCenter
}
z: 200
}*/
}*/
}
}
...
...
src/qml/compositor.qml
View file @
7020765f
...
@@ -148,6 +148,12 @@ Compositor {
...
@@ -148,6 +148,12 @@ Compositor {
else
if
(
!
root
.
appActive
&&
DeviceLock
.
state
!==
DeviceLock
.
Locked
)
{
else
if
(
!
root
.
appActive
&&
DeviceLock
.
state
!==
DeviceLock
.
Locked
)
{
state
=
"
cover
"
state
=
"
cover
"
}
}
else
if
(
Desktop
.
instance
.
lockscreenVisible
()
&&
DeviceLock
.
state
===
DeviceLock
.
Locked
&&
!
Desktop
.
instance
.
codepadVisible
)
{
//state = "pullCodepad"
}
else
if
(
Desktop
.
instance
.
lockscreenVisible
()
&&
DeviceLock
.
state
===
DeviceLock
.
Locked
&&
Desktop
.
instance
.
codepadVisible
)
{
//state = "pushCodepad"
}
}
}
onGestureFinished
:
{
onGestureFinished
:
{
...
@@ -174,7 +180,15 @@ Compositor {
...
@@ -174,7 +180,15 @@ Compositor {
if
(
gesture
==
"
down
"
)
{
if
(
gesture
==
"
down
"
)
{
setDisplayOff
()
setDisplayOff
()
}
}
}
/*
// Brings up codepad, only left and right swipes allowed for it for now
else if (Desktop.instance.lockscreenVisible() && !Desktop.instance.codepad.visible && DeviceLock.state == DeviceLock.Locked && (gesture !== "down" && gesture !== "up")) {
Desktop.instance.codepadVisible = true
}
}
// Hides codepad but does not unlock the code, only left and right swipes allowed for now
else if (Desktop.instance.lockscreenVisible() && Desktop.instance.codepad.visible && DeviceLock.state == DeviceLock.Locked && gesture !== "down" && gesture !== "up") {
Desktop.instance.codepadVisible = false
}*/
// Unlocks if no security code required
// Unlocks if no security code required
else
if
(
DeviceLock
.
state
!==
DeviceLock
.
Locked
&&
Desktop
.
instance
.
lockscreenVisible
())
{
else
if
(
DeviceLock
.
state
!==
DeviceLock
.
Locked
&&
Desktop
.
instance
.
lockscreenVisible
())
{
Desktop
.
instance
.
setLockScreen
(
false
)
Desktop
.
instance
.
setLockScreen
(
false
)
...
@@ -233,7 +247,64 @@ Compositor {
...
@@ -233,7 +247,64 @@ Compositor {
Desktop
.
instance
.
lockscreen
.
height
:
Desktop
.
instance
.
lockscreen
.
height
:
Desktop
.
instance
.
lockscreen
.
width
)
+
gestureArea
.
value
)
)
)
Desktop
.
instance
.
lockscreen
.
width
)
+
gestureArea
.
value
)
)
)
}
}
}
}
/*
// pullCodepad is when you are pulling codepad into view to enter security code
State {
name: "pullCodepad"
when: DeviceLock.state >= DeviceLock.Locked//Desktop.instance.codepadVisible
PropertyChanges {
target: Desktop.instance
codepadVisible: true
}
PropertyChanges {
target: gestureArea
delayReset: true
}
PropertyChanges {
target: Desktop.instance.codepad
// Confusing logic and math to get the codepad follow your finger
x: gestureArea.lockscreenX + (gestureArea.value < 0 ? Desktop.instance.lockscreen.width : -Desktop.instance.lockscreen.width) +
((gestureArea.horizontal) ? (Desktop.instance.lockscreenVisible()?(gestureArea.value) :
(gestureArea.gesture == "right" ?
((Desktop.instance.lockscreen.width === topmostWindow.width) ?
-Desktop.instance.lockscreen.width :
-Desktop.instance.lockscreen.height)+Math.abs(gestureArea.value) :
((Desktop.instance.lockscreen.width === topmostWindow.width) ?
Desktop.instance.lockscreen.width :
Desktop.instance.lockscreen.height)+gestureArea.value) ) : 0 )
// Bringing up the codepad opacity from 0 to 1
opacity: gestureArea.horizontal ? (gestureArea.value < 0 ? (gestureArea.value / -Desktop.instance.lockscreen.width) :
gestureArea.value / Desktop.instance.lockscreen.width) : 0
}
},
// pushCodepad is when you are pushing the codepad away without entering a security code
State {
name: "pushCodepad"
when: Desktop.instance.lockscreenVisible() && DeviceLock.state === DeviceLock.Locked && Desktop.instance.codepadVisible
PropertyChanges {
target: gestureArea
delayReset: true
}
PropertyChanges {
target: Desktop.instance.codepad
// Confusing logic for the codepad to follow your swipe
x: gestureArea.lockscreenX +
((gestureArea.horizontal) ? (Desktop.instance.lockscreenVisible()?(gestureArea.value) :
(gestureArea.gesture == "right" ?
((Desktop.instance.lockscreen.width === topmostWindow.width) ?
-Desktop.instance.lockscreen.width :
-Desktop.instance.lockscreen.height)+Math.abs(gestureArea.value) :
((Desktop.instance.lockscreen.width === topmostWindow.width) ?
Desktop.instance.lockscreen.width :
Desktop.instance.lockscreen.height)+gestureArea.value) ) : 0 )
// Hiding the codepad with opacity fading from 1 to 0
opacity: 1 - (gestureArea.horizontal ? (gestureArea.value < 0 ? (gestureArea.value / -Desktop.instance.lockscreen.width) :
gestureArea.value / Desktop.instance.lockscreen.width) : 0)
}
}*/
]
]
SequentialAnimation
{
SequentialAnimation
{
...
...
src/qml/compositor_new.qml
View file @
7020765f
...
@@ -166,11 +166,11 @@ Item {
...
@@ -166,11 +166,11 @@ Item {
},
},
State
{
State
{
name
:
"
lock
"
name
:
"
lock
"
when
:
De
viceLock
.
state
==
DeviceLock
.
Locked
when
:
De
sktop
.
instance
.
state
===
"
locked
"
PropertyChanges
{
/*
PropertyChanges {
target: Desktop.instance.lockscreen
target: Desktop.instance.lockscreen
visible: true
visible: true
}
}
*/
PropertyChanges
{
PropertyChanges
{
target
:
gestureArea
target
:
gestureArea
delayReset
:
true
delayReset
:
true
...
@@ -199,7 +199,7 @@ Item {
...
@@ -199,7 +199,7 @@ Item {
// pullCodepad is when you are pulling codepad into view to enter security code
// pullCodepad is when you are pulling codepad into view to enter security code
State
{
State
{
name
:
"
pullCodepad
"
name
:
"
pullCodepad
"
when
:
Desktop
.
instance
.
codepadVisible
when
:
Desktop
.
instance
.
state
===
"
locked
"
&&
!
Desktop
.
instance
.
codepadVisible
PropertyChanges
{
PropertyChanges
{
target
:
Desktop
.
instance
target
:
Desktop
.
instance
codepadVisible
:
true
codepadVisible
:
true
...
@@ -230,7 +230,7 @@ Item {
...
@@ -230,7 +230,7 @@ Item {
// pushCodepad is when you are pushing the codepad away without entering a security code
// pushCodepad is when you are pushing the codepad away without entering a security code
State
{
State
{
name
:
"
pushCodepad
"
name
:
"
pushCodepad
"
when
:
Desktop
.
instance
.
lockscreenVisible
()
&&
DeviceLock
.
state
===
DeviceLock
.
Locked
&&
Desktop
.
instance
.
codepadVisible
when
:
Desktop
.
instance
.
state
===
"
locked
"
&&
Desktop
.
instance
.
codepadVisible
PropertyChanges
{
PropertyChanges
{
target
:
gestureArea
target
:
gestureArea
...
...
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