Merge lp:~lukas-kde/unity8/windowOpenCloseAnimations into lp:unity8

Proposed by Lukáš Tinkl
Status: Superseded
Proposed branch: lp:~lukas-kde/unity8/windowOpenCloseAnimations
Merge into: lp:unity8
Diff against target: 234 lines (+104/-13)
2 files modified
qml/Stages/DesktopStage.qml (+75/-13)
tests/qmltests/Stages/tst_DesktopStage.qml (+29/-0)
To merge this branch: bzr merge lp:~lukas-kde/unity8/windowOpenCloseAnimations
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+282027@code.launchpad.net

This proposal has been superseded by a proposal from 2016-01-08.

Description of the change

WIP: window open/close animations in desktop stage

To post a comment you must log in.
2111. By Lukáš Tinkl

fix maximized windows' closing animation

2112. By Lukáš Tinkl

fixup the failing test_windowClose()

need to wait for the anim to finish

2113. By Lukáš Tinkl

simplify the closeApplication() arguments

2114. By Lukáš Tinkl

settle on standard UbuntuNumberAnimation, looks much smoother

2115. By Lukáš Tinkl

merge trunk

2116. By Lukáš Tinkl

tune the closing animations to be a tad faster (as designed) and much smoother

2117. By Lukáš Tinkl

make the initial animation also a bit faster

2118. By Lukáš Tinkl

use the correct Reverse easing, pause the animation briefly before closing the app

2119. By Lukáš Tinkl

fix saving the state on closing (the delegate is no longer in maximized state)

2120. By Lukáš Tinkl

fix opacity and scale properties for apps that are started maximized

2121. By Lukáš Tinkl

fixup failing tests

2122. By Lukáš Tinkl

merge lp:~mzanetti/unity8/launcher-sizing

2123. By Nick Dedekind

fix disappearing windows

2124. By Lukáš Tinkl

merge prereq

2125. By Lukáš Tinkl

reevaluate the screen size by making it a binding

fixes tiny windows when switching stages

2126. By Lukáš Tinkl

drive just the appDelegate in states and transitions

2127. By Lukáš Tinkl

restore max states

2128. By Lukáš Tinkl

partial revert, turn the x/y coords into a binding as well
(they depend on screenWidth/Height too)

2129. By Lukáš Tinkl

simplify code, fix restoring maximized windows

2130. By Lukáš Tinkl

make close() a method of the delegate

2131. By Lukáš Tinkl

merge prereq, fix conflicts

2132. By Lukáš Tinkl

merge lp:~unity-team/unity8/launcher-sizing

2133. By Lukáš Tinkl

merge prereq

2134. By Lukáš Tinkl

merge trunk

2135. By Lukáš Tinkl

handle the close case coming from launcher

2136. By Lukáš Tinkl

fix the launcher ApplicationManager mock

2137. By Lukáš Tinkl

restart app if focusing doesn't work

happens with dash sometimes

2138. By Lukáš Tinkl

make the close animation testable using the App checkbox

2139. By Lukáš Tinkl

fix fullscreen apps being offset by the left margin

2140. By Lukáš Tinkl

disallow resizing windows up past the Panel

2141. By Lukáš Tinkl

fix closing animation for minimized apps

2142. By Lukáš Tinkl

fullscreen apps fix

2143. By Lukáš Tinkl

fix for fullscreen windows height

2144. By Lukáš Tinkl

merge lp:~mzanetti/unity8/launcher-sizing

2145. By Lukáš Tinkl

revert keymap (unrelated) changes

2146. By Lukáš Tinkl

depend on -15 appl framework

2147. By Lukáš Tinkl

implement maximizeHorizontally/Vertically

2148. By Lukáš Tinkl

requestStop() here

2149. By Lukáš Tinkl

save/restore the correct state in all cases

implement (easy now) maximize horizontal/vertical using it

2150. By Lukáš Tinkl

merge trunk

2151. By Lukáš Tinkl

merge trunk

2152. By Lukáš Tinkl

merge trunk

2153. By Lukáš Tinkl

merge trunk, resolve conflicts

2154. By Lukáš Tinkl

merge trunk

2155. By Lukáš Tinkl

merge trunk

Unmerged revisions

2155. By Lukáš Tinkl

merge trunk

2154. By Lukáš Tinkl

merge trunk

2153. By Lukáš Tinkl

merge trunk, resolve conflicts

2152. By Lukáš Tinkl

merge trunk

2151. By Lukáš Tinkl

merge trunk

2150. By Lukáš Tinkl

merge trunk

2149. By Lukáš Tinkl

save/restore the correct state in all cases

implement (easy now) maximize horizontal/vertical using it

2148. By Lukáš Tinkl

requestStop() here

2147. By Lukáš Tinkl

implement maximizeHorizontally/Vertically

2146. By Lukáš Tinkl

depend on -15 appl framework

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Stages/DesktopStage.qml'
2--- qml/Stages/DesktopStage.qml 2015-11-30 17:27:47 +0000
3+++ qml/Stages/DesktopStage.qml 2016-01-08 16:21:55 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright (C) 2014-2015 Canonical, Ltd.
7+ * Copyright (C) 2014-2016 Canonical, Ltd.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11@@ -55,9 +55,8 @@
12 }
13
14 onFocusRequested: {
15- var appIndex = priv.indexOf(appId);
16- var appDelegate = appRepeater.itemAt(appIndex);
17- appDelegate.restore();
18+ var delegate = priv.appDelegate(appId);
19+ delegate.restore();
20
21 if (spread.state == "altTab") {
22 spread.cancel();
23@@ -68,7 +67,7 @@
24 GlobalShortcut {
25 id: closeWindowShortcut
26 shortcut: Qt.AltModifier|Qt.Key_F4
27- onTriggered: ApplicationManager.stopApplication(priv.focusedAppId)
28+ onTriggered: priv.closeApplication(priv.focusedAppDelegate, priv.focusedAppId)
29 active: priv.focusedAppId !== ""
30 }
31
32@@ -124,16 +123,20 @@
33 onFocusedAppDelegateChanged: updateForegroundMaximizedApp();
34
35 property int foregroundMaximizedAppZ: -1
36+ property int foregroundMaximizedAppIndex: -1 // for stuff like drop shadow and focusing maximized app by clicking panel
37
38 function updateForegroundMaximizedApp() {
39 var tmp = -1;
40+ var tmpAppId = -1;
41 for (var i = appRepeater.count - 1; i >= 0; i--) {
42 var item = appRepeater.itemAt(i);
43 if (item && item.visuallyMaximized) {
44+ tmpAppId = i;
45 tmp = Math.max(tmp, item.normalZ);
46 }
47 }
48 foregroundMaximizedAppZ = tmp;
49+ foregroundMaximizedAppIndex = tmpAppId;
50 }
51
52 function indexOf(appId) {
53@@ -166,18 +169,30 @@
54 }
55 }
56 }
57+
58+ function appDelegate(appId) {
59+ var appIndex = indexOf(appId);
60+ return appRepeater.itemAt(appIndex);
61+ }
62+
63+ function closeApplication(delegate, appId) {
64+ var del = delegate || appDelegate(appId);
65+ print("!!! initial delegate state", del.state)
66+ del.state = "closing";
67+ print("!!! target delegate state", del.state)
68+ }
69 }
70
71 Connections {
72 target: PanelState
73 onClose: {
74- ApplicationManager.stopApplication(ApplicationManager.focusedApplicationId)
75+ priv.closeApplication(priv.focusedAppDelegate, ApplicationManager.focusedApplicationId)
76 }
77 onMinimize: priv.focusedAppDelegate && priv.focusedAppDelegate.minimize();
78 onMaximize: priv.focusedAppDelegate // don't restore minimized apps when double clicking the panel
79 && priv.focusedAppDelegate.restoreFromMaximized();
80- onFocusMaximizedApp: if (priv.foregroundMaximizedAppIdIndex != -1) {
81- ApplicationManager.focusApplication(appRepeater.itemAt(priv.foregroundMaximizedAppIdIndex).appId);
82+ onFocusMaximizedApp: if (priv.foregroundMaximizedAppIndex != -1) {
83+ ApplicationManager.focusApplication(appRepeater.itemAt(priv.foregroundMaximizedAppIndex).appId);
84 }
85 }
86
87@@ -206,7 +221,7 @@
88 Binding {
89 target: PanelState
90 property: "dropShadow"
91- value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppIdIndex !== -1
92+ value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppIndex !== -1
93 }
94
95 Component.onDestruction: {
96@@ -335,6 +350,9 @@
97
98 states: [
99 State {
100+ name: "closing"
101+ },
102+ State {
103 name: "fullscreen"; when: decoratedWindow.fullscreen
104 extend: "maximized"
105 PropertyChanges {
106@@ -389,14 +407,30 @@
107 to: "normal"
108 enabled: appDelegate.animationsEnabled
109 PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" }
110- UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration }
111+ UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedWidth,requestedHeight" }
112+ NumberAnimation {
113+ target: appDelegate
114+ property: 'scale'
115+ from: 0.85
116+ to: 1
117+ duration: UbuntuAnimation.SnapDuration
118+ easing: UbuntuAnimation.StandardEasing
119+ }
120+ NumberAnimation {
121+ target: appDelegate
122+ property: 'opacity'
123+ from: 0
124+ to: 1
125+ duration: UbuntuAnimation.SnapDuration
126+ easing: UbuntuAnimation.StandardEasing
127+ }
128 },
129 Transition {
130 to: "minimized"
131 enabled: appDelegate.animationsEnabled
132 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
133 SequentialAnimation {
134- UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration }
135+ UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale" }
136 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
137 ScriptAction {
138 script: {
139@@ -408,11 +442,39 @@
140 }
141 },
142 Transition {
143+ to: "closing"
144+ SequentialAnimation {
145+ ParallelAnimation {
146+ NumberAnimation {
147+ target: appDelegate
148+ property: 'scale'
149+ from: 1
150+ to: 0.85
151+ duration: UbuntuAnimation.SnapDuration
152+ easing: UbuntuAnimation.StandardEasingReverse
153+ }
154+ NumberAnimation {
155+ target: appDelegate
156+ property: 'opacity'
157+ from: 1
158+ to: 0
159+ duration: UbuntuAnimation.SnapDuration
160+ easing: UbuntuAnimation.StandardEasingReverse
161+ }
162+ }
163+ ScriptAction {
164+ script: {
165+ ApplicationManager.stopApplication(appId);
166+ }
167+ }
168+ }
169+ },
170+ Transition {
171 to: "*" //maximized and fullscreen
172 enabled: appDelegate.animationsEnabled
173 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
174 SequentialAnimation {
175- UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration }
176+ UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale" }
177 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
178 }
179 }
180@@ -448,7 +510,7 @@
181 active: ApplicationManager.focusedApplicationId === model.appId
182 focus: true
183
184- onClose: ApplicationManager.stopApplication(model.appId)
185+ onClose: priv.closeApplication(appDelegate, model.appId)
186 onMaximize: appDelegate.maximized || appDelegate.maximizedLeft || appDelegate.maximizedRight
187 ? appDelegate.restoreFromMaximized() : appDelegate.maximize()
188 onMinimize: appDelegate.minimize()
189
190=== modified file 'tests/qmltests/Stages/tst_DesktopStage.qml'
191--- tests/qmltests/Stages/tst_DesktopStage.qml 2015-12-08 15:37:51 +0000
192+++ tests/qmltests/Stages/tst_DesktopStage.qml 2016-01-08 16:21:55 +0000
193@@ -25,6 +25,7 @@
194 import ".." // For EdgeBarrierControls
195 import "../../../qml/Stages"
196 import "../../../qml/Components"
197+import "../../../qml/Components/PanelState"
198
199 Item {
200 id: root
201@@ -500,5 +501,33 @@
202 tryCompare(dialerAppDelegate, "visible", true);
203 tryCompare(facebookAppDelegate, "visible", false);
204 }
205+
206+ function test_dropShadow() {
207+ killAllRunningApps();
208+
209+ // verify the drop shadow is not visible initially
210+ verify(PanelState.dropShadow == false);
211+
212+ // start an app, maximize it
213+ var facebookApp = startApplication("facebook-webapp");
214+ var facebookAppDelegate = findChild(desktopStage, "appDelegate_facebook-webapp");
215+ facebookAppDelegate.maximize();
216+
217+ // verify the drop shadow is still not visible
218+ verify(PanelState.dropShadow == false);
219+
220+ // start a foreground app, not maximized
221+ var dialerApp = startApplication("dialer-app");
222+ var dialerAppDelegate = findChild(desktopStage, "appDelegate_dialer-app");
223+
224+ // verify the drop shadow becomes visible
225+ verify(PanelState.dropShadow == true);
226+
227+ // close the maximized app
228+ ApplicationManager.stopApplication("facebook-webapp");
229+
230+ // verify the drop shadow is gone
231+ verify(PanelState.dropShadow == false);
232+ }
233 }
234 }

Subscribers

People subscribed via source and target branches