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

[LockScreen] Fixup behavor #110

Merged
merged 1 commit into from Feb 11, 2020
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions glacier-home.pro
Expand Up @@ -80,6 +80,7 @@ i18n_files.path = /usr/share/lipstick-glacier-home-qt5/
INSTALLS += i18n_files

DISTFILES += \
src/qml/lockscreen/AngleAnimation.qml \
translations/*.ts \
settings-plugins/*/*.qml \
settings-plugins/*/*.json \
Expand Down
21 changes: 21 additions & 0 deletions src/qml/Lockscreen.qml
Expand Up @@ -11,12 +11,15 @@ import QtQuick.Controls.Styles.Nemo 1.0
import "notifications"
import "lockscreen"

import "scripts/desktop.js" as Desktop

Image {
id: lockScreen
source: lockScreenWallpaper.value
fillMode: Image.PreserveAspectCrop

property bool displayOn
clip: true

ConfigurationValue {
id: differentWallpaper
Expand Down Expand Up @@ -53,6 +56,12 @@ Image {
y = -height
}

onDisplayOnChanged: {
if(lockScreen.displayOn) {
angileAnimation.run()
}
}

function snapPosition() {
if (LipstickSettings.lockscreenVisible) {
snapOpenAnimation.stop()
Expand Down Expand Up @@ -178,4 +187,16 @@ Image {
}
}
}

AngleAnimation {
id: angileAnimation
width: Theme.itemHeightLarge
height: Theme.itemHeightLarge/2*3

anchors{
bottom: parent.bottom
bottomMargin: Theme.itemSpacingSmall
horizontalCenter: parent.horizontalCenter
}
}
}
1 change: 1 addition & 0 deletions src/qml/MainScreen.qml
Expand Up @@ -98,6 +98,7 @@ Page {
readonly property int isUiPortrait: orientation == Qt.PortraitOrientation || orientation == Qt.InvertedPortraitOrientation

property bool codepadVisible: false
property alias displayOn: lockScreen.displayOn
property bool deviceLocked: DeviceLock.state >= DeviceLock.Locked

// Implements back key navigation
Expand Down
21 changes: 14 additions & 7 deletions src/qml/compositor.qml
Expand Up @@ -187,11 +187,12 @@ Compositor {
else if (DeviceLock.state !== DeviceLock.Locked && !diagonal) {
if(gesture == "down") {
/*show statusbar when gesture down*/
console.log("Show statusarea")
}

if(gesture == "up" && !diagonal) {
/*if(gesture == "up" && !diagonal) {
state = "cover"
}
}*/
}
}

Expand Down Expand Up @@ -222,10 +223,10 @@ Compositor {
Desktop.instance.lockscreen.width :
-Desktop.instance.lockscreen.width)
lockAnimation.start()
// Locks, unlocks or brings up codepad to enter security code
// Locks
if (!Desktop.instance.lockscreenVisible()) {
if (gesture == "down") {

if (gesture == "down") {
// swipe down on lockscreen to turn off display
if (Desktop.instance.lockscreenVisible()) {
Desktop.instance.setLockScreen(true)
setDisplayOff()
}
Expand Down Expand Up @@ -364,11 +365,17 @@ Compositor {
WindowWrapperMystic { }
}

onDisplayOff:
onDisplayOff: {
if (root.topmostAlarmWindow == null) {
Desktop.instance.codepadVisible = false
setCurrentWindow(root.homeWindow)
}
Desktop.instance.displayOn = false
}

onDisplayOn: {
Desktop.instance.displayOn = true
}

onWindowAdded: {
console.log("Compositor: Window added \"" + window.title + "\"" + " category: " + window.category)
Expand Down
76 changes: 76 additions & 0 deletions src/qml/lockscreen/AngleAnimation.qml
@@ -0,0 +1,76 @@
/****************************************************************************************
**
** Copyright (C) 2020 Chupligin Sergey <neochapay@gmail.com>
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** * Neither the name of the author nor the
** names of its contributors may be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
****************************************************************************************/

import QtQuick 2.6
import QtQuick.Controls 1.0
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0

Item {
id: angileAnimation

Image{
id: angile1
source: "image://theme/angle-up"
opacity: 0.75
anchors{
top: parent.top
horizontalCenter: parent.horizontalCenter
}
}

function run() {
if(!angileAnimationItem.running) {
angileAnimationItem.running = true;
}
}

Image{
id: angile2
source: "image://theme/angle-up"
opacity: 0.75
width: angile1.width/3*2
height: angile1.height/3*2
anchors{
top: angile1.bottom
topMargin: -height/2
horizontalCenter: parent.horizontalCenter
}
}

SequentialAnimation {
id: angileAnimationItem
NumberAnimation { target: angile2; property: "opacity"; to: 0; duration: 200 }
NumberAnimation { target: angile1; property: "opacity"; to: 0; duration: 200 }
NumberAnimation { target: angile2; property: "opacity"; to: 0.75; duration: 200 }
NumberAnimation { target: angile1; property: "opacity"; to: 0.75; duration: 200 }
}
}