on xenial help sign in
Fade out overlay when skipped
commit358e25497183cea00c38eb51969d84e4b8f43fe5 authorMichael Terry <michael.terry@canonical.com> dateMon 12 Aug 2013, 15:00 (13 years ago) parent99a0740
1 file changed+18−13
Components/DemoOverlay.qml+18−13
Components/DemoOverlay.qml+18−13
@@ -60,8 +60,6 @@ Item {
6060
6161 signal skip()
6262
63− onSkip: overlay.enabled = false
64−
6563 Rectangle {
6664 id: backgroundShade
6765 anchors.fill: parent
@@ -71,8 +69,8 @@ Item {
7169
7270 MouseArea {
7371 anchors.fill: parent
74− enabled: overlay.edge == "none" && backgroundShade.opacity == 0.8
75− onClicked: skip()
72+ enabled: overlay.edge == "none" && overlay.opacity == 1.0
73+ onClicked: fadeOutAnimation.running = true
7674 }
7775 }
7876
@@ -121,7 +119,7 @@ Item {
121119
122120 MouseArea {
123121 anchors.fill: parent
124− onClicked: skip()
122+ onClicked: fadeOutAnimation.running = true
125123 }
126124 }
127125 }
@@ -167,6 +165,20 @@ Item {
167165 }
168166 }
169167
168+ PropertyAnimation {
169+ id: fadeOutAnimation
170+ target: overlay
171+ property: "opacity"
172+ to: 0
173+ duration: 250
174+
175+ onStopped: {
176+ overlay.enabled = false;
177+ overlay.visible = false;
178+ skip()
179+ }
180+ }
181+
170182 SequentialAnimation {
171183 id: wholeAnimation
172184 running: overlay.active
@@ -196,19 +208,12 @@ Item {
196208 duration: overlay.edge == "none" ? 0 : 1000
197209 }
198210 StandardAnimation {
199− target: labelGroup
211+ target: overlay
200212 property: "opacity"
201213 from: 0.0
202214 to: 1.0
203215 duration: 1000
204216 }
205− StandardAnimation {
206− target: backgroundShade
207− property: "opacity"
208− from: 0.0
209− to: 0.8
210− duration: 1000
211− }
212217 }
213218
214219 SequentialAnimation {