diff --git a/glacier-home.pro b/glacier-home.pro index ee317d8c..5985f031 100644 --- a/glacier-home.pro +++ b/glacier-home.pro @@ -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 \ diff --git a/src/qml/Lockscreen.qml b/src/qml/Lockscreen.qml index be3d323f..633cd1ef 100644 --- a/src/qml/Lockscreen.qml +++ b/src/qml/Lockscreen.qml @@ -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 @@ -53,6 +56,12 @@ Image { y = -height } + onDisplayOnChanged: { + if(lockScreen.displayOn) { + angileAnimation.run() + } + } + function snapPosition() { if (LipstickSettings.lockscreenVisible) { snapOpenAnimation.stop() @@ -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 + } + } } diff --git a/src/qml/MainScreen.qml b/src/qml/MainScreen.qml index 5aeb1aae..4ae594d8 100644 --- a/src/qml/MainScreen.qml +++ b/src/qml/MainScreen.qml @@ -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 diff --git a/src/qml/compositor.qml b/src/qml/compositor.qml index f21ba1cb..dc4baf17 100644 --- a/src/qml/compositor.qml +++ b/src/qml/compositor.qml @@ -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" - } + }*/ } } @@ -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() } @@ -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) diff --git a/src/qml/lockscreen/AngleAnimation.qml b/src/qml/lockscreen/AngleAnimation.qml new file mode 100644 index 00000000..280ffee2 --- /dev/null +++ b/src/qml/lockscreen/AngleAnimation.qml @@ -0,0 +1,76 @@ +/**************************************************************************************** +** +** Copyright (C) 2020 Chupligin Sergey +** 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 } + } +}