on xenial help sign in
bring back the closing from spread animation
0f541aeMichael Zanetti
qml/Stages/DesktopStage.qml+11−14
@@ -105,15 +105,6 @@ AbstractStage {
105 active: priv.focusedAppDelegate !== null
105 active: priv.focusedAppDelegate !== null
106 }
106 }
107
107
108− Connections {
109− target: root.topLevelSurfaceList
110− onCountChanged: {
111− if (root.state == "spread") {
112− priv.goneToSpread = false;
113− }
114− }
115− }
116−
117 QtObject {
108 QtObject {
118 id: priv
109 id: priv
119 objectName: "DesktopStagePrivate"
110 objectName: "DesktopStagePrivate"
@@ -129,6 +120,7 @@ AbstractStage {
129 property var foregroundMaximizedAppDelegate: null // for stuff like drop shadow and focusing maximized app by clicking panel
120 property var foregroundMaximizedAppDelegate: null // for stuff like drop shadow and focusing maximized app by clicking panel
130
121
131 property bool goneToSpread: false
122 property bool goneToSpread: false
123+ property int closingIndex: -1
132// property int animationDuration: 4000
124// property int animationDuration: 4000
133 property int animationDuration: UbuntuAnimation.FastDuration
125 property int animationDuration: UbuntuAnimation.FastDuration
134
126
@@ -446,13 +438,16 @@ AbstractStage {
446 }
438 }
447 z: normalZ
439 z: normalZ
448
440
441+ // Normally we want x/y where we request it to be. Width/height of our delegate will
442+ // match what the actual surface size is.
443+ // Don't write to those, they will be set by states
449 x: requestedX
444 x: requestedX
450 y: requestedY
445 y: requestedY
446+ width: decoratedWindow.implicitWidth
447+ height: decoratedWindow.implicitHeight
451
448
452 // requestedX/Y/width/height is what we ask the actual surface to be.
449 // requestedX/Y/width/height is what we ask the actual surface to be.
453 // Do not write to those, they will be set by states
450 // Do not write to those, they will be set by states
454− // Also do not write to the appWindow's actual x,y,width,height as they
455− // will be set by states too.
456 property real requestedX: 0
451 property real requestedX: 0
457 property real requestedY: 0
452 property real requestedY: 0
458 property int requestedWidth: -1
453 property int requestedWidth: -1
@@ -478,8 +473,7 @@ AbstractStage {
478
473
479 }
474 }
480
475
481− width: decoratedWindow.implicitWidth
476+ Behavior on x { id: xBehavior; enabled: priv.closingIndex >= 0; UbuntuNumberAnimation { onRunningChanged: if (!running) priv.closingIndex = -1} }
482− height: decoratedWindow.implicitHeight
483
477
484 Connections {
478 Connections {
485 target: root
479 target: root
@@ -1144,7 +1138,10 @@ AbstractStage {
1144 onContainsMouseChanged: {
1138 onContainsMouseChanged: {
1145 if (containsMouse) spreadItem.highlightedIndex = index
1139 if (containsMouse) spreadItem.highlightedIndex = index
1146 }
1140 }
1141+ onClose: {
1142+ priv.closingIndex = index
1147− onClose: model.surface.close()
1143+ model.surface.close()
1144+ }
1148 }
1145 }
1149
1146
1150// Rectangle { anchors.fill: parent; color: "blue"; opacity: .4 }
1147// Rectangle { anchors.fill: parent; color: "blue"; opacity: .4 }