@@ -90,7 +90,7 @@ FocusScope {
90 StateGroup {
90 StateGroup {
93− name: "normal"; when: root.scaleToPreviewProgress <= 0
93+ name: "normal"; when: root.scaleToPreviewProgress <= 0 && root.application.state === ApplicationInfoInterface.Running
94 PropertyChanges {
94 PropertyChanges {
95 target: root
95 target: root
96 implicitWidth: counterRotate ? applicationWindow.implicitHeight : applicationWindow.implicitWidth
96 implicitWidth: counterRotate ? applicationWindow.implicitHeight : applicationWindow.implicitWidth
@@ -98,7 +98,17 @@ FocusScope {
101+ name: "normalSuspended"; when: root.scaleToPreviewProgress <= 0 && root.application.state !== ApplicationInfoInterface.Running
104+ implicitWidth: counterRotate ? applicationWindow.requestedHeight : applicationWindow.requestedWidth
105+ implicitHeight: root.decorationHeight + (counterRotate ? applicationWindow.requestedWidth: applicationWindow.requestedHeight)
107+// PropertyChanges { target: applicationWindow; anchors.topMargin: (root.height - applicationWindow.implicitHeight) / 2 }
108+// PropertyChanges { target: dropShadow; anchors.topMargin: (root.height - applicationWindow.implicitHeight) / 2 }
101− name: "preview"; when: root.scaleToPreviewProgress > 0
111+ name: "preview"; when: root.scaleToPreviewProgress > 0 && root.application.state === ApplicationInfoInterface.Running
102 PropertyChanges {
112 PropertyChanges {
103 target: root
113 target: root
104 implicitWidth: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedWidth, root.scaleToPreviewSize, root.scaleToPreviewProgress)
114 implicitWidth: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedWidth, root.scaleToPreviewSize, root.scaleToPreviewProgress)
@@ -112,6 +122,16 @@ FocusScope {
112 height: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedHeight, applicationWindow.minSize, root.scaleToPreviewProgress)
122 height: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedHeight, applicationWindow.minSize, root.scaleToPreviewProgress)
113 itemScale: root.implicitWidth / width
123 itemScale: root.implicitWidth / width
127+ name: "previewSuspended"; when: root.scaleToPreviewProgress > 0 && root.application.state !== ApplicationInfoInterface.Running
129+ PropertyChanges { target: applicationWindow;
130+ anchors.verticalCenterOffset: applicationWindow.implicitHeight < applicationWindow.height ?
131+ (root.height / applicationWindow.itemScale - applicationWindow.implicitHeight) / 2
132+ : (root.height / applicationWindow.itemScale - applicationWindow.height) / 2
134+// PropertyChanges { target: dropShadow; anchors.topMargin: (root.height - root.implicitHeight) / 2 * (1 - root.scaleToPreviewProgress) }
@@ -127,10 +147,13 @@ FocusScope {
129 BorderImage {
149 BorderImage {
130 anchors {
151 anchors {
131− fill: root
152+ left: parent.left; top: parent.top; right: parent.right
132 margins: active ? -units.gu(2) : -units.gu(1.5)
153 margins: active ? -units.gu(2) : -units.gu(1.5)
155+ height: Math.min(applicationWindow.implicitHeight, applicationWindow.height) * applicationWindow.itemScale
156+ + root.decorationHeight * Math.min(1, root.showDecoration) + (active ? units.gu(4) : units.gu(3))
134 source: "../graphics/dropshadow2gu.sci"
157 source: "../graphics/dropshadow2gu.sci"
135 opacity: root.shadowOpacity
158 opacity: root.shadowOpacity
@@ -172,8 +195,8 @@ FocusScope {
172 ApplicationWindow {
195 ApplicationWindow {
173 id: applicationWindow
196 id: applicationWindow
174 objectName: "appWindow"
197 objectName: "appWindow"
175− anchors.top: parent.top
198+ anchors.verticalCenter: parent.verticalCenter
176− anchors.topMargin: root.decorationHeight * Math.min(1, root.showDecoration)
199+ anchors.verticalCenterOffset: (root.decorationHeight * Math.min(1, root.showDecoration)) / 2
177 anchors.left: parent.left
200 anchors.left: parent.left
178 width: implicitWidth
201 width: implicitWidth
179 height: implicitHeight
202 height: implicitHeight
@@ -186,7 +209,7 @@ FocusScope {
186 focus: true
209 focus: true
188 property real itemScale: 1
211 property real itemScale: 1
189− property real minSize: Math.min(root.scaleToPreviewSize, Math.min(applicationWindow.requestedHeight, applicationWindow.requestedWidth))
212+ property real minSize: Math.min(root.scaleToPreviewSize, Math.min(requestedHeight, Math.min(requestedWidth, Math.min(implicitHeight, implicitWidth))))
191 transform: [
214 transform: [
192 Rotation {
215 Rotation {
@@ -209,11 +232,12 @@ FocusScope {
209 angle: rotationAngle
232 angle: rotationAngle
235+ origin.y: (applicationWindow.implicitHeight < applicationWindow.height ? applicationWindow.implicitHeight : applicationWindow.height) / 2
212 xScale: applicationWindow.itemScale
236 xScale: applicationWindow.itemScale
213 yScale: applicationWindow.itemScale
237 yScale: applicationWindow.itemScale
219 Rectangle {
243 Rectangle {