Changeset View
Changeset View
Standalone View
Standalone View
effects/squash/package/contents/code/main.js
Show All 31 Lines | 27 | slotWindowMinimized: function (window) { | |||
---|---|---|---|---|---|
32 | // If the window doesn't have an icon in the task manager, | 32 | // If the window doesn't have an icon in the task manager, | ||
33 | // don't animate it. | 33 | // don't animate it. | ||
34 | var iconRect = window.iconGeometry; | 34 | var iconRect = window.iconGeometry; | ||
35 | if (iconRect.width == 0 || iconRect.height == 0) { | 35 | if (iconRect.width == 0 || iconRect.height == 0) { | ||
36 | return; | 36 | return; | ||
37 | } | 37 | } | ||
38 | 38 | | |||
39 | if (window.unminimizeAnimation) { | 39 | if (window.unminimizeAnimation) { | ||
40 | // TODO: Try to reverse it instead. | 40 | if (redirect(window.unminimizeAnimation, Effect.Backward)) { | ||
41 | return; | ||||
42 | } | ||||
41 | cancel(window.unminimizeAnimation); | 43 | cancel(window.unminimizeAnimation); | ||
42 | delete window.unminimizeAnimation; | 44 | delete window.unminimizeAnimation; | ||
43 | } | 45 | } | ||
44 | 46 | | |||
47 | if (window.minimizeAnimation) { | ||||
48 | if (redirect(window.minimizeAnimation, Effect.Forward)) { | ||||
49 | return; | ||||
50 | } | ||||
51 | cancel(window.minimizeAnimation); | ||||
52 | } | ||||
53 | | ||||
45 | var windowRect = window.geometry; | 54 | var windowRect = window.geometry; | ||
46 | 55 | | |||
47 | window.minimizeAnimation = animate({ | 56 | window.minimizeAnimation = animate({ | ||
48 | window: window, | 57 | window: window, | ||
49 | curve: QEasingCurve.InOutSine, | 58 | curve: QEasingCurve.InOutSine, | ||
50 | duration: squashEffect.duration, | 59 | duration: squashEffect.duration, | ||
51 | animations: [ | 60 | animations: [ | ||
52 | { | 61 | { | ||
Show All 36 Lines | 93 | slotWindowUnminimized: function (window) { | |||
89 | // If the window doesn't have an icon in the task manager, | 98 | // If the window doesn't have an icon in the task manager, | ||
90 | // don't animate it. | 99 | // don't animate it. | ||
91 | var iconRect = window.iconGeometry; | 100 | var iconRect = window.iconGeometry; | ||
92 | if (iconRect.width == 0 || iconRect.height == 0) { | 101 | if (iconRect.width == 0 || iconRect.height == 0) { | ||
93 | return; | 102 | return; | ||
94 | } | 103 | } | ||
95 | 104 | | |||
96 | if (window.minimizeAnimation) { | 105 | if (window.minimizeAnimation) { | ||
97 | // TODO: Try to reverse it instead. | 106 | if (redirect(window.minimizeAnimation, Effect.Backward)) { | ||
107 | return; | ||||
108 | } | ||||
98 | cancel(window.minimizeAnimation); | 109 | cancel(window.minimizeAnimation); | ||
99 | delete window.minimizeAnimation; | 110 | delete window.minimizeAnimation; | ||
100 | } | 111 | } | ||
101 | 112 | | |||
113 | if (window.unminimizeAnimation) { | ||||
114 | if (redirect(window.unminimizeAnimation, Effect.Forward)) { | ||||
115 | return; | ||||
116 | } | ||||
117 | cancel(window.unminimizeAnimation); | ||||
118 | } | ||||
119 | | ||||
102 | var windowRect = window.geometry; | 120 | var windowRect = window.geometry; | ||
103 | 121 | | |||
104 | window.unminimizeAnimation = animate({ | 122 | window.unminimizeAnimation = animate({ | ||
105 | window: window, | 123 | window: window, | ||
106 | curve: QEasingCurve.InOutSine, | 124 | curve: QEasingCurve.InOutSine, | ||
107 | duration: squashEffect.duration, | 125 | duration: squashEffect.duration, | ||
108 | animations: [ | 126 | animations: [ | ||
109 | { | 127 | { | ||
Show All 39 Lines |