Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/lockscreen/LockScreenUi.qml
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 30 | PlasmaCore.ColorScope { | |||
---|---|---|---|---|---|
63 | 63 | | |||
64 | Loader { | 64 | Loader { | ||
65 | id: changeSessionComponent | 65 | id: changeSessionComponent | ||
66 | active: false | 66 | active: false | ||
67 | source: "ChangeSession.qml" | 67 | source: "ChangeSession.qml" | ||
68 | visible: false | 68 | visible: false | ||
69 | } | 69 | } | ||
70 | 70 | | |||
71 | Item { | 71 | MouseArea { | ||
72 | id: lockScreenRoot | 72 | id: lockScreenRoot | ||
73 | 73 | | |||
74 | x: parent.x | 74 | x: parent.x | ||
75 | y: parent.y | 75 | y: parent.y | ||
76 | width: parent.width | 76 | width: parent.width | ||
77 | height: parent.height | 77 | height: parent.height | ||
78 | 78 | | |||
79 | Component.onCompleted: PropertyAnimation { id: launchAnimation; target: lockScreenRoot; property: "opacity"; from: 0; to: 1; duration: 1000 } | 79 | Component.onCompleted: PropertyAnimation { id: launchAnimation; target: lockScreenRoot; property: "opacity"; from: 0; to: 1; duration: 1000 } | ||
80 | 80 | | |||
81 | onClicked: inputPanel.state = "hidden"; | ||||
82 | | ||||
81 | states: [ | 83 | states: [ | ||
82 | State { | 84 | State { | ||
83 | name: "onOtherSession" | 85 | name: "onOtherSession" | ||
84 | // for slide out animation | 86 | // for slide out animation | ||
85 | PropertyChanges { target: lockScreenRoot; y: lockScreenRoot.height } | 87 | PropertyChanges { target: lockScreenRoot; y: lockScreenRoot.height } | ||
86 | // we also change the opacity just to be sure it's not visible even on unexpected screen dimension changes with possible race conditions | 88 | // we also change the opacity just to be sure it's not visible even on unexpected screen dimension changes with possible race conditions | ||
87 | PropertyChanges { target: lockScreenRoot; opacity: 0 } | 89 | PropertyChanges { target: lockScreenRoot; opacity: 0 } | ||
88 | } | 90 | } | ||
Show All 14 Lines | 103 | onRunningChanged: { | |||
103 | // and not the other way around, we don't have to check the state we transitioned into | 105 | // and not the other way around, we don't have to check the state we transitioned into | ||
104 | if (/* lockScreenRoot.state == "onOtherSession" && */ !running) { | 106 | if (/* lockScreenRoot.state == "onOtherSession" && */ !running) { | ||
105 | mainStack.currentItem.switchSession() | 107 | mainStack.currentItem.switchSession() | ||
106 | } | 108 | } | ||
107 | } | 109 | } | ||
108 | } | 110 | } | ||
109 | 111 | | |||
110 | Clock { | 112 | Clock { | ||
111 | anchors.bottom: parent.verticalCenter | 113 | anchors.bottom: mainStack.verticalCenter | ||
112 | anchors.bottomMargin: units.gridUnit * 13 | 114 | anchors.bottomMargin: units.gridUnit * 13 | ||
113 | anchors.horizontalCenter: parent.horizontalCenter | 115 | anchors.horizontalCenter: parent.horizontalCenter | ||
114 | } | 116 | } | ||
115 | 117 | | |||
116 | ListModel { | 118 | ListModel { | ||
117 | id: users | 119 | id: users | ||
118 | 120 | | |||
119 | Component.onCompleted: { | 121 | Component.onCompleted: { | ||
120 | users.append({name: kscreenlocker_userName, | 122 | users.append({name: kscreenlocker_userName, | ||
121 | realName: kscreenlocker_userName, | 123 | realName: kscreenlocker_userName, | ||
122 | icon: kscreenlocker_userImage, | 124 | icon: kscreenlocker_userImage, | ||
123 | 125 | | |||
124 | }) | 126 | }) | ||
125 | } | 127 | } | ||
126 | } | 128 | } | ||
127 | 129 | | |||
128 | ColumnLayout { | 130 | | ||
129 | anchors.fill: parent | | |||
130 | StackView { | 131 | StackView { | ||
131 | id: mainStack | 132 | id: mainStack | ||
132 | Layout.fillWidth: true | 133 | anchors { | ||
133 | Layout.fillHeight: true | 134 | left: parent.left | ||
135 | right: parent.right | ||||
136 | } | ||||
137 | height: lockScreenRoot.height | ||||
134 | focus: true //StackView is an implicit focus scope, so we need to give this focus so the item inside will have it | 138 | focus: true //StackView is an implicit focus scope, so we need to give this focus so the item inside will have it | ||
135 | 139 | | |||
136 | initialItem: MainBlock { | 140 | initialItem: MainBlock { | ||
137 | id: mainBlock | 141 | id: mainBlock | ||
138 | 142 | | |||
139 | Stack.onStatusChanged: { | 143 | Stack.onStatusChanged: { | ||
140 | // prepare for presenting again to the user | 144 | // prepare for presenting again to the user | ||
141 | if (Stack.status == Stack.Activating) { | 145 | if (Stack.status == Stack.Activating) { | ||
Show All 32 Lines | |||||
174 | Loader { | 178 | Loader { | ||
175 | Layout.fillWidth: true | 179 | Layout.fillWidth: true | ||
176 | Layout.preferredHeight: item ? item.implicitHeight : 0 | 180 | Layout.preferredHeight: item ? item.implicitHeight : 0 | ||
177 | active: true // TODO configurable | 181 | active: true // TODO configurable | ||
178 | source: "MediaControls.qml" | 182 | source: "MediaControls.qml" | ||
179 | } | 183 | } | ||
180 | } | 184 | } | ||
181 | } | 185 | } | ||
186 | | ||||
182 | Loader { | 187 | Loader { | ||
183 | id: inputPanel | 188 | id: inputPanel | ||
184 | property bool keyboardActive: item ? item.active : false | 189 | state: "hidden" | ||
185 | Layout.fillWidth: true | 190 | readonly property bool keyboardActive: item ? item.active : false | ||
186 | Layout.preferredHeight: item ? (item.active ? item.implicitHeight : 0) : 0 | 191 | anchors { | ||
192 | left: parent.left | ||||
193 | right: parent.right | ||||
194 | } | ||||
187 | function showHide() { | 195 | function showHide() { | ||
188 | if (Qt.inputMethod.visible) { | 196 | state = state == "hidden" ? "visible" : "hidden"; | ||
189 | Qt.inputMethod.hide(); | 197 | } | ||
190 | } else { | 198 | Component.onCompleted: inputPanel.source = "VirtualKeyboard.qml" | ||
191 | item.activated = true; | 199 | | ||
200 | states: [ | ||||
201 | State { | ||||
202 | name: "visible" | ||||
203 | PropertyChanges { | ||||
204 | target: mainStack | ||||
205 | y: Math.min(0, lockScreenRoot.height - inputPanel.height - mainBlock.visibleBoundary) | ||||
206 | } | ||||
207 | PropertyChanges { | ||||
208 | target: inputPanel | ||||
209 | y: lockScreenRoot.height - inputPanel.height | ||||
210 | opacity: 1 | ||||
211 | } | ||||
212 | }, | ||||
213 | State { | ||||
214 | name: "hidden" | ||||
215 | PropertyChanges { | ||||
216 | target: mainStack | ||||
217 | y: 0 | ||||
218 | } | ||||
219 | PropertyChanges { | ||||
220 | target: inputPanel | ||||
221 | y: lockScreenRoot.height - units.gridUnit * 10 | ||||
222 | opacity: 0 | ||||
223 | } | ||||
224 | } | ||||
225 | ] | ||||
226 | transitions: [ | ||||
227 | Transition { | ||||
228 | from: "hidden" | ||||
229 | to: "visible" | ||||
230 | SequentialAnimation { | ||||
231 | ScriptAction { | ||||
232 | script: { | ||||
233 | inputPanel.item.active = true; | ||||
192 | Qt.inputMethod.show(); | 234 | Qt.inputMethod.show(); | ||
193 | } | 235 | } | ||
194 | } | 236 | } | ||
195 | Component.onCompleted: inputPanel.source = "VirtualKeyboard.qml" | 237 | ParallelAnimation { | ||
238 | NumberAnimation { | ||||
239 | target: mainStack | ||||
240 | property: "y" | ||||
241 | duration: units.longDuration | ||||
242 | easing.type: Easing.InOutQuad | ||||
243 | } | ||||
244 | NumberAnimation { | ||||
245 | target: inputPanel | ||||
246 | property: "y" | ||||
247 | duration: units.longDuration | ||||
248 | easing.type: Easing.OutQuad | ||||
249 | } | ||||
250 | OpacityAnimator { | ||||
251 | target: inputPanel | ||||
252 | duration: units.longDuration | ||||
253 | easing.type: Easing.OutQuad | ||||
254 | } | ||||
255 | } | ||||
196 | } | 256 | } | ||
257 | }, | ||||
258 | Transition { | ||||
259 | from: "visible" | ||||
260 | to: "hidden" | ||||
261 | SequentialAnimation { | ||||
262 | ParallelAnimation { | ||||
263 | NumberAnimation { | ||||
264 | target: mainStack | ||||
265 | property: "y" | ||||
266 | duration: units.longDuration | ||||
267 | easing.type: Easing.InOutQuad | ||||
268 | } | ||||
269 | NumberAnimation { | ||||
270 | target: inputPanel | ||||
271 | property: "y" | ||||
272 | duration: units.longDuration | ||||
273 | easing.type: Easing.InQuad | ||||
274 | } | ||||
275 | OpacityAnimator { | ||||
276 | target: inputPanel | ||||
277 | duration: units.longDuration | ||||
278 | easing.type: Easing.InQuad | ||||
279 | } | ||||
280 | } | ||||
281 | ScriptAction { | ||||
282 | script: { | ||||
283 | Qt.inputMethod.hide(); | ||||
284 | inputPanel.item.active = false; | ||||
285 | } | ||||
286 | } | ||||
287 | } | ||||
288 | } | ||||
289 | ] | ||||
197 | } | 290 | } | ||
198 | 291 | | |||
199 | Component { | 292 | Component { | ||
200 | id: switchSessionPage | 293 | id: switchSessionPage | ||
201 | SessionManagementScreen { | 294 | SessionManagementScreen { | ||
202 | property var switchSession: finalSwitchSession | 295 | property var switchSession: finalSwitchSession | ||
203 | 296 | | |||
204 | Stack.onStatusChanged: { | 297 | Stack.onStatusChanged: { | ||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |