Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- a/lockscreen/LockScreenUi.qml 2017-02-28 15:08:10.000000000 +0200
- +++ b/lockscreen/LockScreenUi.qml 2017-03-05 12:08:49.936593711 +0200
- @@ -67,6 +67,22 @@
- source: "ChangeSession.qml"
- visible: false
- }
- +
- + Rectangle {
- + id: mouseTrap
- + width: parent.width
- + height: parent.height
- + color: "transparent"
- +
- + MouseArea {
- + anchors.fill: parent
- + hoverEnabled: true
- + onPositionChanged: {
- + lockScreenRoot.state = ''
- + //console.log("mouse moved")
- + }
- + }
- + }
- Item {
- id: lockScreenRoot
- @@ -85,15 +101,22 @@
- PropertyChanges { target: lockScreenRoot; y: lockScreenRoot.height }
- // we also change the opacity just to be sure it's not visible even on unexpected screen dimension changes with possible race conditions
- PropertyChanges { target: lockScreenRoot; opacity: 0 }
- + },
- +
- + State {
- + name: "hideText"
- + // for slide up animation
- + PropertyChanges { target: lockScreenRoot; y: - lockScreenRoot.height }
- + PropertyChanges { target: lockScreenRoot; opacity: 0 }
- }
- ]
- - transitions:
- + transitions: [
- Transition {
- // we only animate switchting to another session, because kscreenlocker doesn't get notified when
- // coming from another session back and so we wouldn't know when to trigger the animation exactly
- from: ""
- - to: "onOtherSession"
- + to: "onOtherSession", "hideText"
- PropertyAnimation { id: stateChangeAnimation; properties: "y"; duration: 300; easing: Easing.InQuad}
- PropertyAnimation { properties: "opacity"; duration: 300}
- @@ -105,68 +128,103 @@
- mainStack.currentItem.switchSession()
- }
- }
- + },
- + Transition {
- + from: "hideText"
- + to: ""
- + PropertyAnimation { id: coverChangeAnimation; properties: "y"; duration: 300; easing: Easing.InQuad}
- + } ]
- +
- + Rectangle {
- + id: coverText
- + width: parent.width
- + height: parent.height
- + color: "#F2000000"
- +
- + Keys.onPressed: {
- + if (event.key == Qt.Key_Up) {
- + lockScreenRoot.state = 'hideText'
- + //console.log("Up")
- + }
- + if (event.key == Qt.Key_Down) {
- + lockScreenRoot.state = ''
- + //console.log("Down")
- + }
- }
- - Clock {
- - anchors.bottom: parent.verticalCenter
- - anchors.bottomMargin: units.gridUnit * 13
- - anchors.horizontalCenter: parent.horizontalCenter
- - }
- + Timer {
- + id: moveCover
- + // 3 min in milliseconds
- + interval: 3 * 60 * 1000
- + repeat: true
- + running: true
- + onTriggered: {
- + lockScreenRoot.state = 'hideText'
- + //console.log("Time")
- + }
- + }
- +
- + Clock {
- + anchors.bottom: parent.verticalCenter
- + anchors.bottomMargin: units.gridUnit * 13
- + anchors.horizontalCenter: parent.horizontalCenter
- + }
- - ListModel {
- - id: users
- + ListModel {
- + id: users
- - Component.onCompleted: {
- - users.append({name: kscreenlocker_userName,
- - realName: kscreenlocker_userName,
- - icon: kscreenlocker_userImage,
- + Component.onCompleted: {
- + users.append({name: kscreenlocker_userName,
- + realName: kscreenlocker_userName,
- + icon: kscreenlocker_userImage,
- - })
- + })
- + }
- }
- - }
- - StackView {
- - id: mainStack
- - anchors.fill: parent
- - focus: true //StackView is an implicit focus scope, so we need to give this focus so the item inside will have it
- + StackView {
- + id: mainStack
- + anchors.fill: parent
- + focus: true //StackView is an implicit focus scope, so we need to give this focus so the item inside will have it
- - initialItem: MainBlock {
- - id: mainBlock
- + initialItem: MainBlock {
- + id: mainBlock
- - Stack.onStatusChanged: {
- - // prepare for presenting again to the user
- - if (Stack.status == Stack.Activating) {
- - mainPasswordBox.remove(0, mainPasswordBox.length)
- - mainPasswordBox.focus = true
- + Stack.onStatusChanged: {
- + // prepare for presenting again to the user
- + if (Stack.status == Stack.Activating) {
- + mainPasswordBox.remove(0, mainPasswordBox.length)
- + mainPasswordBox.focus = true
- + }
- }
- - }
- - userListModel: users
- - notificationMessage: {
- - var text = ""
- - if (keystateSource.data["Caps Lock"]["Locked"]) {
- - text += i18nd("plasma_lookandfeel_org.kde.lookandfeel","Caps Lock is on")
- - if (root.notification) {
- - text += " • "
- + userListModel: users
- + notificationMessage: {
- + var text = ""
- + if (keystateSource.data["Caps Lock"]["Locked"]) {
- + text += i18nd("plasma_lookandfeel_org.kde.lookandfeel","Caps Lock is on")
- + if (root.notification) {
- + text += " • "
- + }
- }
- + text += root.notification
- + return text
- }
- - text += root.notification
- - return text
- - }
- -
- - onLoginRequest: {
- - root.notification = ""
- - authenticator.tryUnlock(password)
- - }
- - actionItems: [
- - ActionButton {
- - text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch User")
- - iconSource: "system-switch-user"
- - onClicked: mainStack.push(switchSessionPage)
- - // the current session isn't listed in the model, hence a check for greater than zero, not one
- - visible: (sessionsModel.count > 0 || sessionsModel.canStartNewSession) && sessionsModel.canSwitchUser
- + onLoginRequest: {
- + root.notification = ""
- + authenticator.tryUnlock(password)
- }
- - ]
- +
- + actionItems: [
- + ActionButton {
- + text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch User")
- + iconSource: "system-switch-user"
- + onClicked: mainStack.push(switchSessionPage)
- + // the current session isn't listed in the model, hence a check for greater than zero, not one
- + visible: (sessionsModel.count > 0 || sessionsModel.canStartNewSession) && sessionsModel.canSwitchUser
- + }
- + ]
- + }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement