on xenial help sign in
fix stuff from review
a5f8994Michael Zanetti
qml/Stages/PhoneStage.qml+12−12
@@ -109,9 +109,9 @@ Item {
109 QtObject {
109 QtObject {
110 id: priv
110 id: priv
111
111
112− readonly property string focusedAppId: ApplicationManager.focusedApplicationId
112+ property string focusedAppId: ApplicationManager.focusedApplicationId
113− readonly property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
113+ property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
114− readonly property url focusedScreenshot: focusedApplication ? focusedApplication.screenshot : ""
114+ property url focusedScreenshot: focusedApplication ? focusedApplication.screenshot : ""
115
115
116 property bool waitingForScreenshot: false
116 property bool waitingForScreenshot: false
117
117
@@ -123,7 +123,7 @@ Item {
123 onFocusedScreenshotChanged: {
123 onFocusedScreenshotChanged: {
124 if (root.moving && priv.waitingForScreenshot) {
124 if (root.moving && priv.waitingForScreenshot) {
125 mainScreenshotImage.anchors.leftMargin = 0;
125 mainScreenshotImage.anchors.leftMargin = 0;
126− mainScreenshotImage.src = ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).screenshot;
126+ mainScreenshotImage.src = priv.focusedScreenshot
127 mainScreenshotImage.visible = true;
127 mainScreenshotImage.visible = true;
128 } else if (priv.secondApplicationStarting && priv.waitingForScreenshot) {
128 } else if (priv.secondApplicationStarting && priv.waitingForScreenshot) {
129 applicationSwitchingAnimation.start();
129 applicationSwitchingAnimation.start();
@@ -133,7 +133,7 @@ Item {
133
133
134 function requestNewScreenshot() {
134 function requestNewScreenshot() {
135 waitingForScreenshot = true;
135 waitingForScreenshot = true;
136− ApplicationManager.updateScreenshot(ApplicationManager.focusedApplicationId);
136+ ApplicationManager.updateScreenshot(focusedAppId);
137 }
137 }
138
138
139 function switchToApp(appId) {
139 function switchToApp(appId) {
@@ -154,7 +154,6 @@ Item {
154 }
154 }
155
155
156 // FIXME: the signal connections seems to get lost.
156 // FIXME: the signal connections seems to get lost.
157− // Check with Qt 5.2, see if we can remove this Connections and Binding objects
158 Connections {
157 Connections {
159 target: priv.focusedApplication
158 target: priv.focusedApplication
160 onScreenshotChanged: priv.focusedScreenshot = priv.focusedApplication.screenshot
159 onScreenshotChanged: priv.focusedScreenshot = priv.focusedApplication.screenshot
@@ -183,11 +182,13 @@ Item {
183 id: applicationSwitchingAnimation
182 id: applicationSwitchingAnimation
184 // setup
183 // setup
185 PropertyAction { target: mainScreenshotImage; property: "anchors.leftMargin"; value: 0 }
184 PropertyAction { target: mainScreenshotImage; property: "anchors.leftMargin"; value: 0 }
186− // PropertyAction seems to fail when secondApplicationStarting and we didn't have another screenshot before
185+ // FIXME: PropertyAction seems to fail when secondApplicationStarting and we didn't have another screenshot before
187 ScriptAction { script: mainScreenshotImage.src = priv.focusedScreenshot }
186 ScriptAction { script: mainScreenshotImage.src = priv.focusedScreenshot }
188− PropertyAction { target: mainScreenshotImage; property: "visible"; value: true }
187+ PropertyAction { targets: [mainScreenshotImage, fadeInScreenshotImage]; property: "visible"; value: true }
189− PropertyAction { target: fadeInScreenshotImage; property: "source"; value: ApplicationManager.findApplication(priv.newFocusedAppId) ? ApplicationManager.findApplication(priv.newFocusedAppId).screenshot : "" }
188+ PropertyAction { target: fadeInScreenshotImage; property: "source"; value: {
190− PropertyAction { target: fadeInScreenshotImage; property: "visible"; value: true }
189+ var newFocusedApp = ApplicationManager.findApplication(priv.newFocusedAppId);
190+ return newFocusedApp ? newFocusedApp.screenshot : "" }
191+ }
191 PropertyAction { target: fadeInScreenshotImage; property: "opacity"; value: 0 }
192 PropertyAction { target: fadeInScreenshotImage; property: "opacity"; value: 0 }
192 PropertyAction { target: fadeInScreenshotImage; property: "scale"; value: .8 }
193 PropertyAction { target: fadeInScreenshotImage; property: "scale"; value: .8 }
193
194
@@ -195,8 +196,7 @@ Item {
195 // The actual animation
196 // The actual animation
196 ParallelAnimation {
197 ParallelAnimation {
197 UbuntuNumberAnimation { target: mainScreenshotImage; property: "anchors.leftMargin"; to: root.width; duration: UbuntuAnimation.SlowDuration }
198 UbuntuNumberAnimation { target: mainScreenshotImage; property: "anchors.leftMargin"; to: root.width; duration: UbuntuAnimation.SlowDuration }
198− UbuntuNumberAnimation { target: fadeInScreenshotImage; property: "opacity"; to: 1; duration: UbuntuAnimation.SlowDuration }
199+ UbuntuNumberAnimation { target: fadeInScreenshotImage; properties: "opacity,scale"; to: 1; duration: UbuntuAnimation.SlowDuration }
199− UbuntuNumberAnimation { target: fadeInScreenshotImage; property: "scale"; to: 1; duration: UbuntuAnimation.SlowDuration }
200 }
200 }
201
201
202 // restore stuff
202 // restore stuff