on xenial help sign in
some fixes
commit1422dda74e8a6db0526f043824e21f712664ce79 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 28 Sep 2016, 13:27 (10 years ago) parentaadcb3d
2 files changed+32−8
qml/Stage/DecoratedWindow.qml+31−7 qml/Stage/Stage.qml+1−1
qml/Stage/DecoratedWindow.qml+31−7
@@ -90,7 +90,7 @@ FocusScope {
9090 StateGroup {
9191 states: [
9292 State {
93− name: "normal"; when: root.scaleToPreviewProgress <= 0
93+ name: "normal"; when: root.scaleToPreviewProgress <= 0 && root.application.state === ApplicationInfoInterface.Running
9494 PropertyChanges {
9595 target: root
9696 implicitWidth: counterRotate ? applicationWindow.implicitHeight : applicationWindow.implicitWidth
@@ -98,7 +98,17 @@ FocusScope {
9898 }
9999 },
100100 State {
101− name: "preview"; when: root.scaleToPreviewProgress > 0
101+ name: "normalSuspended"; when: root.scaleToPreviewProgress <= 0 && root.application.state !== ApplicationInfoInterface.Running
102+ PropertyChanges {
103+ target: root
104+ implicitWidth: counterRotate ? applicationWindow.requestedHeight : applicationWindow.requestedWidth
105+ implicitHeight: root.decorationHeight + (counterRotate ? applicationWindow.requestedWidth: applicationWindow.requestedHeight)
106+ }
107+// PropertyChanges { target: applicationWindow; anchors.topMargin: (root.height - applicationWindow.implicitHeight) / 2 }
108+// PropertyChanges { target: dropShadow; anchors.topMargin: (root.height - applicationWindow.implicitHeight) / 2 }
109+ },
110+ State {
111+ name: "preview"; when: root.scaleToPreviewProgress > 0 && root.application.state === ApplicationInfoInterface.Running
102112 PropertyChanges {
103113 target: root
104114 implicitWidth: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedWidth, root.scaleToPreviewSize, root.scaleToPreviewProgress)
@@ -112,6 +122,16 @@ FocusScope {
112122 height: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedHeight, applicationWindow.minSize, root.scaleToPreviewProgress)
113123 itemScale: root.implicitWidth / width
114124 }
125+ },
126+ State {
127+ name: "previewSuspended"; when: root.scaleToPreviewProgress > 0 && root.application.state !== ApplicationInfoInterface.Running
128+ extend: "preview"
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
133+ }
134+// PropertyChanges { target: dropShadow; anchors.topMargin: (root.height - root.implicitHeight) / 2 * (1 - root.scaleToPreviewProgress) }
115135 }
116136 ]
117137 }
@@ -127,10 +147,13 @@ FocusScope {
127147 }
128148
129149 BorderImage {
150+ id: dropShadow
130151 anchors {
131− fill: root
152+ left: parent.left; top: parent.top; right: parent.right
132153 margins: active ? -units.gu(2) : -units.gu(1.5)
133154 }
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))
134157 source: "../graphics/dropshadow2gu.sci"
135158 opacity: root.shadowOpacity
136159 }
@@ -172,8 +195,8 @@ FocusScope {
172195 ApplicationWindow {
173196 id: applicationWindow
174197 objectName: "appWindow"
175− anchors.top: parent.top
176− anchors.topMargin: root.decorationHeight * Math.min(1, root.showDecoration)
198+ anchors.verticalCenter: parent.verticalCenter
199+ anchors.verticalCenterOffset: (root.decorationHeight * Math.min(1, root.showDecoration)) / 2
177200 anchors.left: parent.left
178201 width: implicitWidth
179202 height: implicitHeight
@@ -186,7 +209,7 @@ FocusScope {
186209 focus: true
187210
188211 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))))
190213
191214 transform: [
192215 Rotation {
@@ -209,11 +232,12 @@ FocusScope {
209232 angle: rotationAngle
210233 },
211234 Scale {
235+ origin.y: (applicationWindow.implicitHeight < applicationWindow.height ? applicationWindow.implicitHeight : applicationWindow.height) / 2
212236 xScale: applicationWindow.itemScale
213237 yScale: applicationWindow.itemScale
214238 }
215−
216239 ]
240+
217241 }
218242
219243 Rectangle {
qml/Stage/Stage.qml+1−1
@@ -765,7 +765,7 @@ FocusScope {
765765 if (focus) {
766766 topLevelSurfaceList.raiseId(model.id);
767767 priv.focusedAppDelegate = appDelegate;
768− } else if (!focus && priv.focusedAppDelegate === appDelegate) {
768+ } else if (!focus && priv.focusedAppDelegate === appDelegate && root.state != "spread") {
769769 priv.focusedAppDelegate = null;
770770 // FIXME: No idea why the Binding{} doens't update when focusedAppDelegate turns null
771771 MirFocusController.focusedSurface = null;