on xenial help sign in
Fix regression found during code review
ca86d0aDaniel d'Andrada
qml/Stages/SpreadDelegate.qml+16−2
@@ -204,10 +204,22 @@ FocusScope {
204 }
204 }
205
205
206 states: [
206 states: [
207+ // A base state containing bindings common to others
208+ // Ensures appWindowWithShadow fills the root area.
209+ State {
210+ name: "fillRootArea"
211+ PropertyChanges {
212+ target: appWindowWithShadow
213+ restoreEntryValues: false
214+ width: appWindowWithShadow.rotation == 0 || appWindowWithShadow.rotation == 180 ? root.width : root.height
215+ height: appWindowWithShadow.rotation == 0 || appWindowWithShadow.rotation == 180 ? root.height : root.width
216+ }
217+ },
207 // In this state we stick to our currently set orientationAngle, which may change only due
218 // In this state we stick to our currently set orientationAngle, which may change only due
208 // to calls made to matchShellOrientation() or animateToShellOrientation()
219 // to calls made to matchShellOrientation() or animateToShellOrientation()
209 State {
220 State {
210 name: "keepSceneRotation"
221 name: "keepSceneRotation"
222+ extend: "fillRootArea"
211 PropertyChanges {
223 PropertyChanges {
212 target: appWindowWithShadow
224 target: appWindowWithShadow
213 restoreEntryValues: false
225 restoreEntryValues: false
@@ -219,6 +231,7 @@ FocusScope {
219 // But the splash screen should still obey the set orientationAngle set by shell
231 // But the splash screen should still obey the set orientationAngle set by shell
220 State {
232 State {
221 name: "counterRotate"
233 name: "counterRotate"
234+ extend: "fillRootArea"
222 PropertyChanges {
235 PropertyChanges {
223 target: appWindowWithShadow
236 target: appWindowWithShadow
224 rotation: normalizeAngle(-root.shellOrientationAngle)
237 rotation: normalizeAngle(-root.shellOrientationAngle)
@@ -229,14 +242,15 @@ FocusScope {
229 splashRotation: appWindowWithShadow.orientationAngle
242 splashRotation: appWindowWithShadow.orientationAngle
230 }
243 }
231 },
244 },
245+ // Dummy state.
246+ // The animation may indiscriminately break any bindings assigned to appWindowWithShadow rotation,
247+ // width or height.
232 State {
248 State {
233 name: "animatingRotation"
249 name: "animatingRotation"
234 }
250 }
235 ]
251 ]
236
252
237 anchors.centerIn: parent
253 anchors.centerIn: parent
238− width: rotation == 0 || rotation == 180 ? root.width : root.height
239− height: rotation == 0 || rotation == 180 ? root.height : root.width
240
254
241 BorderImage {
255 BorderImage {
242 anchors {
256 anchors {