on xenial help sign in
animate closing
commit16eabaa31e94828b393dc5d2715148db1c90914b authorMichael Zanetti <michael.zanetti@canonical.com> dateMon 6 Jul 2015, 14:19 (11 years ago) parentb05bc26
2 files changed+19−7
qml/Stages/DesktopStage.qml+17−7 tests/qmltests/tst_Shell.qml+2
qml/Stages/DesktopStage.qml+17−7
@@ -57,6 +57,7 @@ Rectangle {
5757
5858 onAltTabPressedChanged: {
5959 if (!altTabPressed && root.state == "altTab") {
60+ print("released", appRepeater.highlightedIndex)
6061 ApplicationManager.requestFocusApplication(ApplicationManager.get(appRepeater.highlightedIndex).appId)
6162 }
6263 }
@@ -173,9 +174,7 @@ Rectangle {
173174 objectName: "appRepeater"
174175
175176 property int highlightedIndex: -1
176− onHighlightedIndexChanged: {
177− print("****** changed:", highlightedIndex)
178− }
177+ property int closingIndex: -1
179178
180179 delegate: FocusScope {
181180 id: appDelegate
@@ -198,6 +197,14 @@ Rectangle {
198197 }
199198 }
200199
200+ Behavior on x {
201+ id: closeBehavior
202+ enabled: appRepeater.closingIndex >= 0
203+ UbuntuNumberAnimation {
204+ onRunningChanged: if (!running) appRepeater.closingIndex = -1
205+ }
206+ }
207+
201208 states: [
202209 State {
203210 name: "normal"
@@ -321,7 +328,6 @@ Rectangle {
321328 onMouseYChanged: evaluateContainsMouse()
322329 function evaluateContainsMouse() {
323330 if (containsMouse) {
324− print("setting highlighted to", index)
325331 appRepeater.highlightedIndex = index
326332 }
327333
@@ -360,7 +366,11 @@ Rectangle {
360366 anchors.fill: closeImage
361367 anchors.margins: -units.gu(1)
362368 enabled: spreadSelectArea.enabled
363− onClicked: ApplicationManager.stopApplication(model.appId)
369+ onClicked: {
370+ print("enabling clsoeBehaviro")
371+ appRepeater.closingIndex = index;
372+ ApplicationManager.stopApplication(model.appId)
373+ }
364374 }
365375
366376 ColumnLayout {
@@ -519,6 +529,7 @@ Rectangle {
519529 from: "*"
520530 to: "altTab"
521531 SequentialAnimation {
532+ PropertyAction { target: appRepeater; property: "highlightedIndex"; value: 1 }
522533 PauseAnimation { duration: 50 }
523534 PropertyAction { target: workspaceSelector; property: "visible" }
524535 ScriptAction { script: root.updateWorkspaces() }
@@ -526,9 +537,8 @@ Rectangle {
526537 PauseAnimation { duration: 10 }
527538 PropertyAction { target: root; property: "workspacesUpdated"; value: true }
528539 PropertyAction { target: spreadFlickable; property: "visible" }
529− PropertyAction { target: currentSelectedLabel; property: "visible" }
540+ PropertyAction { targets: [currentSelectedLabel,spreadBackground]; property: "visible" }
530541 PropertyAction { target: spreadFlickable; property: "contentX"; value: 0 }
531− PropertyAction { target: appRepeater; property: "highlightedIndex"; value: 1 }
532542 }
533543 },
534544 Transition {
tests/qmltests/tst_Shell.qml+2
@@ -1310,7 +1310,9 @@ Rectangle {
13101310 shell.usageScenario = "desktop"
13111311 waitForRendering(root)
13121312
1313+ wait(5000)
13131314 var desktopStage = findChild(shell, "stage");
1315+ print("desktopStage", desktopStage)
13141316 verify(desktopStage != null)
13151317
13161318 var app1 = ApplicationManager.startApplication("dialer-app")