Advertisement
Guest User

LockScreenUi.diff

a guest
Mar 5th, 2017
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.14 KB | None | 0 0
  1. --- a/lockscreen/LockScreenUi.qml 2017-02-28 15:08:10.000000000 +0200
  2. +++ b/lockscreen/LockScreenUi.qml 2017-03-05 12:08:49.936593711 +0200
  3. @@ -67,6 +67,22 @@
  4. source: "ChangeSession.qml"
  5. visible: false
  6. }
  7. +
  8. + Rectangle {
  9. + id: mouseTrap
  10. + width: parent.width
  11. + height: parent.height
  12. + color: "transparent"
  13. +
  14. + MouseArea {
  15. + anchors.fill: parent
  16. + hoverEnabled: true
  17. + onPositionChanged: {
  18. + lockScreenRoot.state = ''
  19. + //console.log("mouse moved")
  20. + }
  21. + }
  22. + }
  23.  
  24. Item {
  25. id: lockScreenRoot
  26. @@ -85,15 +101,22 @@
  27. PropertyChanges { target: lockScreenRoot; y: lockScreenRoot.height }
  28. // we also change the opacity just to be sure it's not visible even on unexpected screen dimension changes with possible race conditions
  29. PropertyChanges { target: lockScreenRoot; opacity: 0 }
  30. + },
  31. +
  32. + State {
  33. + name: "hideText"
  34. + // for slide up animation
  35. + PropertyChanges { target: lockScreenRoot; y: - lockScreenRoot.height }
  36. + PropertyChanges { target: lockScreenRoot; opacity: 0 }
  37. }
  38. ]
  39.  
  40. - transitions:
  41. + transitions: [
  42. Transition {
  43. // we only animate switchting to another session, because kscreenlocker doesn't get notified when
  44. // coming from another session back and so we wouldn't know when to trigger the animation exactly
  45. from: ""
  46. - to: "onOtherSession"
  47. + to: "onOtherSession", "hideText"
  48.  
  49. PropertyAnimation { id: stateChangeAnimation; properties: "y"; duration: 300; easing: Easing.InQuad}
  50. PropertyAnimation { properties: "opacity"; duration: 300}
  51. @@ -105,68 +128,103 @@
  52. mainStack.currentItem.switchSession()
  53. }
  54. }
  55. + },
  56. + Transition {
  57. + from: "hideText"
  58. + to: ""
  59. + PropertyAnimation { id: coverChangeAnimation; properties: "y"; duration: 300; easing: Easing.InQuad}
  60. + } ]
  61. +
  62. + Rectangle {
  63. + id: coverText
  64. + width: parent.width
  65. + height: parent.height
  66. + color: "#F2000000"
  67. +
  68. + Keys.onPressed: {
  69. + if (event.key == Qt.Key_Up) {
  70. + lockScreenRoot.state = 'hideText'
  71. + //console.log("Up")
  72. + }
  73. + if (event.key == Qt.Key_Down) {
  74. + lockScreenRoot.state = ''
  75. + //console.log("Down")
  76. + }
  77. }
  78.  
  79. - Clock {
  80. - anchors.bottom: parent.verticalCenter
  81. - anchors.bottomMargin: units.gridUnit * 13
  82. - anchors.horizontalCenter: parent.horizontalCenter
  83. - }
  84. + Timer {
  85. + id: moveCover
  86. + // 3 min in milliseconds
  87. + interval: 3 * 60 * 1000
  88. + repeat: true
  89. + running: true
  90. + onTriggered: {
  91. + lockScreenRoot.state = 'hideText'
  92. + //console.log("Time")
  93. + }
  94. + }
  95. +
  96. + Clock {
  97. + anchors.bottom: parent.verticalCenter
  98. + anchors.bottomMargin: units.gridUnit * 13
  99. + anchors.horizontalCenter: parent.horizontalCenter
  100. + }
  101.  
  102. - ListModel {
  103. - id: users
  104. + ListModel {
  105. + id: users
  106.  
  107. - Component.onCompleted: {
  108. - users.append({name: kscreenlocker_userName,
  109. - realName: kscreenlocker_userName,
  110. - icon: kscreenlocker_userImage,
  111. + Component.onCompleted: {
  112. + users.append({name: kscreenlocker_userName,
  113. + realName: kscreenlocker_userName,
  114. + icon: kscreenlocker_userImage,
  115.  
  116. - })
  117. + })
  118. + }
  119. }
  120. - }
  121.  
  122. - StackView {
  123. - id: mainStack
  124. - anchors.fill: parent
  125. - focus: true //StackView is an implicit focus scope, so we need to give this focus so the item inside will have it
  126. + StackView {
  127. + id: mainStack
  128. + anchors.fill: parent
  129. + focus: true //StackView is an implicit focus scope, so we need to give this focus so the item inside will have it
  130.  
  131. - initialItem: MainBlock {
  132. - id: mainBlock
  133. + initialItem: MainBlock {
  134. + id: mainBlock
  135.  
  136. - Stack.onStatusChanged: {
  137. - // prepare for presenting again to the user
  138. - if (Stack.status == Stack.Activating) {
  139. - mainPasswordBox.remove(0, mainPasswordBox.length)
  140. - mainPasswordBox.focus = true
  141. + Stack.onStatusChanged: {
  142. + // prepare for presenting again to the user
  143. + if (Stack.status == Stack.Activating) {
  144. + mainPasswordBox.remove(0, mainPasswordBox.length)
  145. + mainPasswordBox.focus = true
  146. + }
  147. }
  148. - }
  149. - userListModel: users
  150. - notificationMessage: {
  151. - var text = ""
  152. - if (keystateSource.data["Caps Lock"]["Locked"]) {
  153. - text += i18nd("plasma_lookandfeel_org.kde.lookandfeel","Caps Lock is on")
  154. - if (root.notification) {
  155. - text += " • "
  156. + userListModel: users
  157. + notificationMessage: {
  158. + var text = ""
  159. + if (keystateSource.data["Caps Lock"]["Locked"]) {
  160. + text += i18nd("plasma_lookandfeel_org.kde.lookandfeel","Caps Lock is on")
  161. + if (root.notification) {
  162. + text += " • "
  163. + }
  164. }
  165. + text += root.notification
  166. + return text
  167. }
  168. - text += root.notification
  169. - return text
  170. - }
  171. -
  172. - onLoginRequest: {
  173. - root.notification = ""
  174. - authenticator.tryUnlock(password)
  175. - }
  176.  
  177. - actionItems: [
  178. - ActionButton {
  179. - text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch User")
  180. - iconSource: "system-switch-user"
  181. - onClicked: mainStack.push(switchSessionPage)
  182. - // the current session isn't listed in the model, hence a check for greater than zero, not one
  183. - visible: (sessionsModel.count > 0 || sessionsModel.canStartNewSession) && sessionsModel.canSwitchUser
  184. + onLoginRequest: {
  185. + root.notification = ""
  186. + authenticator.tryUnlock(password)
  187. }
  188. - ]
  189. +
  190. + actionItems: [
  191. + ActionButton {
  192. + text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch User")
  193. + iconSource: "system-switch-user"
  194. + onClicked: mainStack.push(switchSessionPage)
  195. + // the current session isn't listed in the model, hence a check for greater than zero, not one
  196. + visible: (sessionsModel.count > 0 || sessionsModel.canStartNewSession) && sessionsModel.canSwitchUser
  197. + }
  198. + ]
  199. + }
  200. }
  201. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement