Commit 473f44f3 authored by m2ko's avatar m2ko

Mainly lockscreen functionality, some minor scaling changes

parent adbe1224
......@@ -22,8 +22,9 @@
// Copyright (c) 2011, Tom Swindell <t.swindell@rubyx.co.uk>
// Copyright (c) 2012, Timur Kristóf <venemo@fedoraproject.org>
import QtQuick 2.2
import QtQuick 2.6
import org.nemomobile.lipstick 0.1
import QtQuick.Controls 1.0
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
import org.nemomobile.glacier 1.0
......@@ -33,7 +34,6 @@ import org.nemomobile.glacier 1.0
Item {
id: switcherRoot
property bool closeMode: false
property bool visibleInHome: false
property alias runningAppsCount: switcherModel.itemCount
......@@ -46,12 +46,32 @@ Item {
closeMode = false;
}
}
// Empty switcher indicator
Rectangle {
id: topText
visible: switcherModel.itemCount === 0
width: noAppsLabel.width
anchors {
horizontalCenter: parent.horizontalCenter
topMargin: Theme.itemSpacingLarge
}
color: "black"
Label {
id: noAppsLabel
text: qsTr("No apps open")
anchors {
top: parent.top
left: parent.left
}
font.weight: Font.Light
font.pointSize: Theme.fontSizeTiny
}
}
Flickable {
id: flickable
contentHeight: gridview.height
width: closeMode ? parent.width - 20 : parent.width // see comment re right anchor below
MouseArea {
height: flickable.contentHeight > flickable.height ? flickable.contentHeight : flickable.height
width: flickable.width
......@@ -181,12 +201,4 @@ Item {
}
}
}
// Empty switcher indicator
Label {
visible: switcherModel.itemCount === 0
text: qsTr("No apps open")
width: parent.width
fontSizeMode: Text.HorizontalFit
}
}
......@@ -7,6 +7,8 @@ import QtQuick.Layouts 1.0
import org.nemomobile.lipstick 0.1
import org.nemomobile.devicelock 1.0
import "scripts/desktop.js" as Desktop
Item {
id: root
......@@ -39,6 +41,8 @@ Item {
id: authenticator
onAuthenticated: {
DeviceLock.unlock(authenticationToken)
Desktop.instance.setLockScreen(false)
Desktop.instance.codepadVisible = false
}
onFeedback: {
console.log('### still locked', feedback, attemptsRemaining)
......
......@@ -43,7 +43,7 @@ Flickable {
// Day of week
Rectangle {
id: daterow
height: displayCurrentDate.height + 15
height: Theme.itemHeightMedium
width: childrenRect.width
anchors{
......@@ -59,8 +59,8 @@ Flickable {
id: displayDayOfWeek
text: Qt.formatDateTime(wallClock.time, "dddd") + ", "
color: Theme.textColor
font.pixelSize: Theme.fontSizeExtraLarge
font.bold: true
font.pointSize: Theme.fontSizeTiny / 1.5
font.weight: Font.Bold
anchors {
top: parent.top
left: parent.left
......@@ -71,8 +71,9 @@ Flickable {
Label {
id: displayCurrentDate
text: Qt.formatDate(wallClock.time, "d MMMM yyyy")
font.pixelSize: Theme.fontSizeExtraLarge
font.pointSize: Theme.fontSizeTiny / 1.5
color: Theme.textColor
font.weight: Font.Light
wrapMode: Text.WordWrap
anchors {
left: displayDayOfWeek.right
......@@ -86,7 +87,7 @@ Flickable {
width: parent.width
anchors{
top: daterow.bottom
topMargin: 50
topMargin: Theme.itemSpacingHuge
}
spacing: Theme.itemSpacingHuge
Repeater {
......
......@@ -14,7 +14,6 @@ Image {
key: "/home/glacier/lockScreen/wallpaperImage"
defaultValue: "/usr/share/lipstick-glacier-home-qt5/qml/images/graphics-wallpaper-home.jpg"
}
LockscreenClock {
id: clock
anchors {
......@@ -25,6 +24,7 @@ Image {
}
DeviceLockUI {
id: deviceLockUI
visible: false//DeviceLock.state === DeviceLock.Locked
anchors {
top: clock.bottom
left: parent.left
......
import QtQuick 2.0
import QtQuick 2.1
import org.nemomobile.devicelock 1.0
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
Rectangle {
id: lockscreenClock
......@@ -22,10 +25,10 @@ Rectangle {
Text {
id: timeDisplay
font.pointSize: 16
font.pointSize: Theme.fontSizeExtraLarge
font.weight: Font.Light
lineHeight: 0.85
color: "white"
color: Theme.textColor
horizontalAlignment: Text.AlignHCenter
anchors {
......@@ -35,22 +38,46 @@ Rectangle {
text: Qt.formatDateTime(wallClock.time, "hh:mm")
}
Rectangle {
id: dateRow
height: weekdayDisplay.height
width: weekdayDisplay.width + dateDisplay.width
anchors {
horizontalCenter: parent.horizontalCenter
}
Text {
id: dateDisplay
color: "transparent"
font.pointSize: 14
color: "white"
opacity: 0.8
horizontalAlignment: Text.AlignHCenter
Label {
id: weekdayDisplay
font.pointSize: Theme.fontSizeTiny / 1.5
color: Theme.textColor
horizontalAlignment: Text.AlignHCenter
font.weight: Font.Bold
anchors {
left: parent.left
right: parent.right
}
text: Qt.formatDateTime(wallClock.time, "<b>dddd</b>, d MMMM yyyy")
text: Qt.formatDateTime(wallClock.time, "dddd") + ", "
}
Label {
id: dateDisplay
font.pointSize: Theme.fontSizeTiny / 1.5
color: Theme.textColor
horizontalAlignment: Text.AlignHCenter
font.weight: Font.Light
anchors {
left: weekdayDisplay.right
top: parent.top
}
text: Qt.formatDate(wallClock.time, "d MMMM yyyy")
}
}
}
}
......@@ -58,7 +58,10 @@ Page {
id: desktop
property alias lockscreen: lockScreen
property alias switcher: switcher
property alias codepad: codePad
property int statusBarHeight: statusbar.height
property bool codepadVisible: false
// Implements back key navigation
Keys.onReleased: {
......@@ -142,7 +145,7 @@ Page {
}
// Initial view should be the AppLauncher
currentIndex: 0
//currentIndex: 0
}
Image {
id:wallpaper
......@@ -153,10 +156,19 @@ Page {
}
Lockscreen {
id: lockScreen
visible: DeviceLock.state >= DeviceLock.Locked
visible: lockscreenVisible()//DeviceLock.state == DeviceLock.Locked
width: parent.width
height: parent.height
z: 200
}
DeviceLockUI {
id: codePad
visible: DeviceLock.state == DeviceLock.Locked && codepadVisible
width: lockScreen.width
height:lockScreen.height / 2
anchors.centerIn: lockScreen
z: 200
}
}
......@@ -42,13 +42,13 @@ import "statusbar"
Item {
id: root
z: 201
height: Math.min(parent.width,parent.height)/10
height: Theme.itemHeightMedium
width: parent.width
anchors.bottom: parent.bottom
Rectangle {
id: statusbar
color: "black"
color: Theme.fillDarkColor
anchors.fill: parent
opacity: 0.5
z: 200
......
......@@ -135,7 +135,7 @@ Compositor {
property real lockThreshold: 0.25
property int lockscreenX
property int lockscreenY
enabled: DeviceLock.state != DeviceLock.Locked
enabled: !Desktop.instance.codepadVisible//DeviceLock.state != DeviceLock.Locked
onGestureStarted: {
swipeAnimation.stop()
......@@ -163,10 +163,17 @@ Compositor {
Desktop.instance.lockscreen.width :
-Desktop.instance.lockscreen.width)
lockAnimation.start()
// Locks or unlocks depending if the screen is locked.
// Locks, unlocks or brings up codepad to enter security code
//Locks
if (!Desktop.instance.lockscreenVisible()) {
Desktop.instance.setLockScreen(true)
} else {
}
//Brings up codepad
else if (Desktop.instance.lockscreenVisible() && !Desktop.instance.codepad.visible && DeviceLock.state == DeviceLock.Locked) {
Desktop.instance.codepadVisible = true
}
//Unlocks if no security code required
else if (DeviceLock.state !== DeviceLock.Locked && Desktop.instance.lockscreenVisible()) {
Desktop.instance.setLockScreen(false)
}
} else {
......@@ -178,7 +185,7 @@ Compositor {
states: [
State {
name: "swipe"
when: DeviceLock.state != DeviceLock.Locked
when: !Desktop.instance.codepadVisible
PropertyChanges {
target: gestureArea
delayReset: true
......@@ -192,7 +199,7 @@ Compositor {
},
State {
name: "lock"
when: DeviceLock.state == DeviceLock.Locked
when: Desktop.instance.lockscreenVisible()
PropertyChanges {
target: Desktop.instance.lockscreen
visible: true
......@@ -221,7 +228,6 @@ Compositor {
Desktop.instance.lockscreen.width)+gestureArea.value) ) )
}
}
]
SequentialAnimation {
......@@ -242,6 +248,23 @@ Compositor {
}
}
SequentialAnimation {
id: codePadAnimation
property alias valueTo: valueAnimationCode.to
SmoothedAnimation {
id: valueAnimationCode
target: Desktop.instance.codepad
property: "opacity"
easing.type: Easing.OutQuint
}
PropertyAction {
target: gestureArea
property: "state"
value: ""
}
}
SequentialAnimation {
id: lockAnimation
property alias valueTo: valueAnimationLock.to
......
......@@ -145,7 +145,7 @@ Item {
//bottomMargin: notificationArea.notificationMargin
}
font.pixelSize: Theme.fontSizeLarge
text: "Notification"//notificationPreviewPresenter.notification != null ? notificationPreviewPresenter.notification.previewSummary : ""
text: notificationPreviewPresenter.notification != null ? notificationPreviewPresenter.notification.previewSummary : ""
color: Theme.textColor
clip: true
elide: Text.ElideRight
......
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