on xenial help sign in
animate closing
16eabaaMichael Zanetti
qml/Stages/DesktopStage.qml+17−7
@@ -57,6 +57,7 @@ Rectangle {
57
57
58 onAltTabPressedChanged: {
58 onAltTabPressedChanged: {
59 if (!altTabPressed && root.state == "altTab") {
59 if (!altTabPressed && root.state == "altTab") {
60+ print("released", appRepeater.highlightedIndex)
60 ApplicationManager.requestFocusApplication(ApplicationManager.get(appRepeater.highlightedIndex).appId)
61 ApplicationManager.requestFocusApplication(ApplicationManager.get(appRepeater.highlightedIndex).appId)
61 }
62 }
62 }
63 }
@@ -173,9 +174,7 @@ Rectangle {
173 objectName: "appRepeater"
174 objectName: "appRepeater"
174
175
175 property int highlightedIndex: -1
176 property int highlightedIndex: -1
176− onHighlightedIndexChanged: {
177+ property int closingIndex: -1
177− print("****** changed:", highlightedIndex)
178− }
179
178
180 delegate: FocusScope {
179 delegate: FocusScope {
181 id: appDelegate
180 id: appDelegate
@@ -198,6 +197,14 @@ Rectangle {
198 }
197 }
199 }
198 }
200
199
200+ Behavior on x {
201+ id: closeBehavior
202+ enabled: appRepeater.closingIndex >= 0
203+ UbuntuNumberAnimation {
204+ onRunningChanged: if (!running) appRepeater.closingIndex = -1
205+ }
206+ }
207+
201 states: [
208 states: [
202 State {
209 State {
203 name: "normal"
210 name: "normal"
@@ -321,7 +328,6 @@ Rectangle {
321 onMouseYChanged: evaluateContainsMouse()
328 onMouseYChanged: evaluateContainsMouse()
322 function evaluateContainsMouse() {
329 function evaluateContainsMouse() {
323 if (containsMouse) {
330 if (containsMouse) {
324− print("setting highlighted to", index)
325 appRepeater.highlightedIndex = index
331 appRepeater.highlightedIndex = index
326 }
332 }
327
333
@@ -360,7 +366,11 @@ Rectangle {
360 anchors.fill: closeImage
366 anchors.fill: closeImage
361 anchors.margins: -units.gu(1)
367 anchors.margins: -units.gu(1)
362 enabled: spreadSelectArea.enabled
368 enabled: spreadSelectArea.enabled
369+ onClicked: {
370+ print("enabling clsoeBehaviro")
371+ appRepeater.closingIndex = index;
363− onClicked: ApplicationManager.stopApplication(model.appId)
372+ ApplicationManager.stopApplication(model.appId)
373+ }
364 }
374 }
365
375
366 ColumnLayout {
376 ColumnLayout {
@@ -519,6 +529,7 @@ Rectangle {
519 from: "*"
529 from: "*"
520 to: "altTab"
530 to: "altTab"
521 SequentialAnimation {
531 SequentialAnimation {
532+ PropertyAction { target: appRepeater; property: "highlightedIndex"; value: 1 }
522 PauseAnimation { duration: 50 }
533 PauseAnimation { duration: 50 }
523 PropertyAction { target: workspaceSelector; property: "visible" }
534 PropertyAction { target: workspaceSelector; property: "visible" }
524 ScriptAction { script: root.updateWorkspaces() }
535 ScriptAction { script: root.updateWorkspaces() }
@@ -526,9 +537,8 @@ Rectangle {
526 PauseAnimation { duration: 10 }
537 PauseAnimation { duration: 10 }
527 PropertyAction { target: root; property: "workspacesUpdated"; value: true }
538 PropertyAction { target: root; property: "workspacesUpdated"; value: true }
528 PropertyAction { target: spreadFlickable; property: "visible" }
539 PropertyAction { target: spreadFlickable; property: "visible" }
529− PropertyAction { target: currentSelectedLabel; property: "visible" }
540+ PropertyAction { targets: [currentSelectedLabel,spreadBackground]; property: "visible" }
530 PropertyAction { target: spreadFlickable; property: "contentX"; value: 0 }
541 PropertyAction { target: spreadFlickable; property: "contentX"; value: 0 }
531− PropertyAction { target: appRepeater; property: "highlightedIndex"; value: 1 }
532 }
542 }
533 },
543 },
534 Transition {
544 Transition {
tests/qmltests/tst_Shell.qml+2
@@ -1310,7 +1310,9 @@ Rectangle {
1310 shell.usageScenario = "desktop"
1310 shell.usageScenario = "desktop"
1311 waitForRendering(root)
1311 waitForRendering(root)
1312
1312
1313+ wait(5000)
1313 var desktopStage = findChild(shell, "stage");
1314 var desktopStage = findChild(shell, "stage");
1315+ print("desktopStage", desktopStage)
1314 verify(desktopStage != null)
1316 verify(desktopStage != null)
1315
1317
1316 var app1 = ApplicationManager.startApplication("dialer-app")
1318 var app1 = ApplicationManager.startApplication("dialer-app")