Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lockscreen being partially shown after orientation change #19

Merged
merged 1 commit into from Jun 13, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/qml/Lockscreen.qml
Expand Up @@ -11,6 +11,15 @@ Image {
**/
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
}

function snapPosition() {
if (LipstickSettings.lockscreenVisible) {
Expand Down Expand Up @@ -71,7 +80,7 @@ Image {
parent.y = parent.y - delta
}

onReleased: {
function snapBack() {
fingerDown = false
if (!LipstickSettings.lockscreenVisible || Math.abs(parent.y) > parent.height / 3) {
LipstickSettings.lockscreenVisible = false
Expand All @@ -81,6 +90,9 @@ Image {

lockScreen.snapPosition()
}

onCanceled: snapBack()
onReleased: snapBack()
}

LockscreenClock {
Expand Down