fix flash on lockscreen
This commit is contained in:
57
Lock.qml
57
Lock.qml
@@ -15,32 +15,17 @@ WlSessionLock {
|
||||
id: surface
|
||||
color: "transparent"
|
||||
|
||||
Component.onCompleted: console.log("done")
|
||||
Rectangle {
|
||||
id: content
|
||||
anchors.fill: parent
|
||||
visible: content.ready
|
||||
readonly property bool ready:
|
||||
lock.animate &&
|
||||
lock.secure &&
|
||||
capture.hasContent
|
||||
color: "#181818"
|
||||
Text {
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
top: parent.top
|
||||
topMargin: surface.height/12
|
||||
}
|
||||
color: "white"
|
||||
font.pixelSize: 160
|
||||
font.family: "Sriracha"
|
||||
property var clock: SystemClock {}
|
||||
text: `${clock.hours}:${clock.minutes}`
|
||||
}
|
||||
opacity: !lock.animate || capture.ready
|
||||
color: "#141414"
|
||||
Rectangle {
|
||||
anchors {
|
||||
bottom: parent.bottom
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
bottomMargin: surface.height/6
|
||||
bottomMargin: surface.height/6 - this.height/2
|
||||
}
|
||||
width: 300
|
||||
height: 40
|
||||
@@ -63,7 +48,7 @@ WlSessionLock {
|
||||
}
|
||||
Text {
|
||||
anchors {
|
||||
horizontalCenter: input.horizontalCenter
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
top: parent.bottom
|
||||
topMargin: 10
|
||||
}
|
||||
@@ -75,10 +60,10 @@ WlSessionLock {
|
||||
}
|
||||
ClippingRectangle {
|
||||
anchors.fill: parent
|
||||
color: "transparent"
|
||||
color: "white"
|
||||
opacity: lock.animate
|
||||
radius: 0
|
||||
RectangularShadow {
|
||||
visible: content.ready
|
||||
anchors.fill: parent
|
||||
spread: 2
|
||||
blur: 10
|
||||
@@ -87,6 +72,11 @@ WlSessionLock {
|
||||
id: capture
|
||||
anchors.fill: parent
|
||||
captureSource: surface.screen
|
||||
readonly property bool ready: {
|
||||
lock.animate &&
|
||||
lock.secure &&
|
||||
capture.hasContent
|
||||
}
|
||||
Connections {
|
||||
target: lock
|
||||
function onLockedChanged() {capture.captureFrame()}
|
||||
@@ -97,26 +87,26 @@ WlSessionLock {
|
||||
xScale: 1
|
||||
yScale: xScale
|
||||
NumberAnimation on xScale {
|
||||
running: content.ready
|
||||
to: 0.85
|
||||
running: capture.ready
|
||||
to: 0.80
|
||||
duration: 800
|
||||
easing.type: Easing.InQuint
|
||||
}
|
||||
NumberAnimation on xScale {
|
||||
id: exit
|
||||
running: false
|
||||
from: 0.85
|
||||
from: 0.8
|
||||
to: 1
|
||||
duration: 800
|
||||
easing.type: Easing.OutQuint
|
||||
onFinished: {
|
||||
content.visible = false
|
||||
fadeOut.start()
|
||||
onStarted: {
|
||||
capture.parent.visible = true
|
||||
}
|
||||
onFinished: lock.locked = false
|
||||
}
|
||||
}
|
||||
SequentialAnimation on opacity {
|
||||
running: content.ready
|
||||
running: capture.ready
|
||||
PauseAnimation {duration: 500}
|
||||
NumberAnimation {
|
||||
duration: 300
|
||||
@@ -130,7 +120,7 @@ WlSessionLock {
|
||||
to: 1
|
||||
}
|
||||
NumberAnimation on radius {
|
||||
running: content.ready
|
||||
running: capture.ready
|
||||
duration: 800
|
||||
to: 32
|
||||
}
|
||||
@@ -139,13 +129,6 @@ WlSessionLock {
|
||||
to: 0
|
||||
duration: 800
|
||||
}
|
||||
NumberAnimation on opacity {
|
||||
id: fadeOut
|
||||
running: false
|
||||
to: 0
|
||||
duration: 150
|
||||
onFinished: lock.locked = false
|
||||
}
|
||||
}
|
||||
PamContext {
|
||||
id: pam
|
||||
|
||||
Reference in New Issue
Block a user