on xenial help sign in
Fade out overlay when skipped
358e254Michael Terry
Components/DemoOverlay.qml+18−13
@@ -60,8 +60,6 @@ Item {
60
60
61 signal skip()
61 signal skip()
62
62
63− onSkip: overlay.enabled = false
64−
65 Rectangle {
63 Rectangle {
66 id: backgroundShade
64 id: backgroundShade
67 anchors.fill: parent
65 anchors.fill: parent
@@ -71,8 +69,8 @@ Item {
71
69
72 MouseArea {
70 MouseArea {
73 anchors.fill: parent
71 anchors.fill: parent
74− enabled: overlay.edge == "none" && backgroundShade.opacity == 0.8
72+ enabled: overlay.edge == "none" && overlay.opacity == 1.0
75− onClicked: skip()
73+ onClicked: fadeOutAnimation.running = true
76 }
74 }
77 }
75 }
78
76
@@ -121,7 +119,7 @@ Item {
121
119
122 MouseArea {
120 MouseArea {
123 anchors.fill: parent
121 anchors.fill: parent
124− onClicked: skip()
122+ onClicked: fadeOutAnimation.running = true
125 }
123 }
126 }
124 }
127 }
125 }
@@ -167,6 +165,20 @@ Item {
167 }
165 }
168 }
166 }
169
167
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+
170 SequentialAnimation {
182 SequentialAnimation {
171 id: wholeAnimation
183 id: wholeAnimation
172 running: overlay.active
184 running: overlay.active
@@ -196,19 +208,12 @@ Item {
196 duration: overlay.edge == "none" ? 0 : 1000
208 duration: overlay.edge == "none" ? 0 : 1000
197 }
209 }
198 StandardAnimation {
210 StandardAnimation {
199− target: labelGroup
211+ target: overlay
200 property: "opacity"
212 property: "opacity"
201 from: 0.0
213 from: 0.0
202 to: 1.0
214 to: 1.0
203 duration: 1000
215 duration: 1000
204 }
216 }
205− StandardAnimation {
206− target: backgroundShade
207− property: "opacity"
208− from: 0.0
209− to: 0.8
210− duration: 1000
211− }
212 }
217 }
213
218
214 SequentialAnimation {
219 SequentialAnimation {