Commit 9c7bb822 authored by Aleksi Suomalainen's avatar Aleksi Suomalainen

[lockscreen] Remove logic from old lockscreen.

parent d15e9c45
......@@ -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
......
......@@ -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
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment