on xenial help sign in
tst_Shell: Update some UI controls
8ce3b8fDaniel d'Andrada
tests/qmltests/tst_Shell.qml+14−17
@@ -131,9 +131,6 @@ Rectangle {
131 anchors.right: root.right
131 anchors.right: root.right
132 width: units.gu(30)
132 width: units.gu(30)
133
133
134− property var focusedApp: ApplicationManager.findApplication(ApplicationManager.focusedApplicationId)
135− property var focusedSurface: focusedApp && focusedApp.session ? focusedApp.session.lastSurface : null
136−
137 Rectangle {
134 Rectangle {
138 id: controlRect
135 id: controlRect
139 anchors { left: parent.left; right: parent.right }
136 anchors { left: parent.left; right: parent.right }
@@ -285,21 +282,21 @@ Rectangle {
285 id: fullscreeAppCheck
282 id: fullscreeAppCheck
286
283
287 onTriggered: {
284 onTriggered: {
288− if (!controls.focusedSurface) return;
285+ if (!MirFocusController.focusedSurface) return;
289− if (controls.focusedSurface.state == Mir.FullscreenState) {
286+ if (MirFocusController.focusedSurface.state == Mir.FullscreenState) {
290− controls.focusedSurface.state = Mir.RestoredState;
287+ MirFocusController.focusedSurface.state = Mir.RestoredState;
291 } else {
288 } else {
292− controls.focusedSurface.state = Mir.FullscreenState;
289+ MirFocusController.focusedSurface.state = Mir.FullscreenState;
293 }
290 }
294 }
291 }
295
292
296 Binding {
293 Binding {
297 target: fullscreeAppCheck
294 target: fullscreeAppCheck
298− when: controls.focusedSurface
295+ when: MirFocusController.focusedSurface
299 property: "checked"
296 property: "checked"
300 value: {
297 value: {
301− if (!controls.focusedSurface) return false;
298+ if (!MirFocusController.focusedSurface) return false;
302− return controls.focusedSurface.state === Mir.FullscreenState
299+ return MirFocusController.focusedSurface.state === Mir.FullscreenState
303 }
300 }
304 }
301 }
305 }
302 }
@@ -313,21 +310,21 @@ Rectangle {
313 id: chromeAppCheck
310 id: chromeAppCheck
314
311
315 onTriggered: {
312 onTriggered: {
316− if (!controls.focusedSurface) return;
313+ if (!MirFocusController.focusedSurface) return;
317− if (controls.focusedSurface.shellChrome == Mir.LowChrome) {
314+ if (MirFocusController.focusedSurface.shellChrome == Mir.LowChrome) {
318− controls.focusedSurface.setShellChrome(Mir.NormalChrome);
315+ MirFocusController.focusedSurface.setShellChrome(Mir.NormalChrome);
319 } else {
316 } else {
320− controls.focusedSurface.setShellChrome(Mir.LowChrome);
317+ MirFocusController.focusedSurface.setShellChrome(Mir.LowChrome);
321 }
318 }
322 }
319 }
323
320
324 Binding {
321 Binding {
325 target: chromeAppCheck
322 target: chromeAppCheck
326− when: controls.focusedSurface !== null
323+ when: MirFocusController.focusedSurface !== null
327 property: "checked"
324 property: "checked"
328 value: {
325 value: {
329− if (!controls.focusedSurface) return false;
326+ if (!MirFocusController.focusedSurface) return false;
330− controls.focusedSurface.shellChrome === Mir.LowChrome
327+ MirFocusController.focusedSurface.shellChrome === Mir.LowChrome
331 }
328 }
332 }
329 }
333 }
330 }