19 import QtGraphicalEffects 1.0
20 import Unity.Application 0.1
21 import Ubuntu.Components 0.1
29 property string edge:
"top"
34 property alias title: titleLabel.text
39 property alias text: textLabel.text
44 property alias skipText: skipLabel.text
49 property alias showSkip: skipLabel.visible
54 readonly
property bool active: available && visible
59 property alias paused: wholeAnimation.paused
64 readonly
property alias running: wholeAnimation.running
74 overlay.visible =
false;
75 overlay.available =
false;
81 showAnimation: StandardAnimation {
84 onRunningChanged:
if (running) overlay.visible =
true
86 hideAnimation: StandardAnimation {
89 duration: UbuntuAnimation.BriskDuration
90 onRunningChanged:
if (!running) overlay.hideNow()
95 property bool skipOnHide:
false
96 property int edgeMargin: units.gu(4)
100 objectName:
"backgroundShade"
105 visible: overlay.active
108 objectName:
"backgroundShadeMouseArea"
111 enabled: overlay.edge ==
"none" && overlay.opacity == 1.0
112 onClicked: overlay.doSkip()
121 height: parent.height
122 visible: overlay.active
129 margins: d.edgeMargin
131 top: overlay.edge ==
"bottom" ? undefined : parent.top
132 bottom: overlay.edge ==
"bottom" ? parent.bottom : undefined
139 wrapMode: Text.WordWrap
145 wrapMode: Text.WordWrap
150 objectName:
"skipLabel"
151 text: i18n.tr(
"Skip intro")
152 color: UbuntuColors.orange
156 anchors.left: parent.right
157 anchors.verticalCenter: parent.verticalCenter
161 color: UbuntuColors.orange
168 anchors.margins: -units.gu(5)
169 onClicked: overlay.doSkip()
178 visible: overlay.edge !=
"none"
182 color: Qt.hsla(16.0/360.0, 0.83, 0.47, 0.4)
191 if (overlay.edge ==
"right") {
192 return Qt.point(width, 0);
193 }
else if (overlay.edge ==
"left") {
194 return Qt.point(0, 0);
195 }
else if (overlay.edge ==
"top") {
196 return Qt.point(0, 0);
198 return Qt.point(0, height);
202 if (overlay.edge ==
"right") {
203 return Qt.point(width - size, 0);
204 }
else if (overlay.edge ==
"left") {
205 return Qt.point(size, 0);
206 }
else if (overlay.edge ==
"top") {
207 return Qt.point(0, size);
209 return Qt.point(0, height - size);
215 SequentialAnimation {
217 objectName:
"wholeAnimation"
218 running: overlay.active
226 if (overlay.edge ==
"right" || overlay.edge ==
"left") {
227 return "anchors.leftMargin";
228 }
else if (overlay.edge ==
"bottom") {
229 return "anchors.bottomMargin";
231 return "anchors.topMargin";
235 if (overlay.edge ==
"right") {
236 return d.edgeMargin + units.gu(3)
238 return d.edgeMargin - units.gu(3)
242 duration: overlay.edge ==
"none" ? 0 : UbuntuAnimation.SleepyDuration
249 duration: UbuntuAnimation.SleepyDuration
253 SequentialAnimation {
255 loops: Animation.Infinite
256 property string prop: (overlay.edge ==
"left" || overlay.edge ==
"right") ?
"x" :
"y"
257 property
double endVal: units.dp(5) * ((overlay.edge ==
"left" || overlay.edge ==
"top") ? 1 : -1)
258 property double maxGlow: units.dp(20)
259 property int duration: overlay.edge ==
"none" ? 0 : UbuntuAnimation.SleepyDuration
262 StandardAnimation { target: hintGroup;
property: hintAnimation.prop; from: 0; to: hintAnimation.endVal; duration: hintAnimation.duration }
263 StandardAnimation { target: edgeHint;
property:
"size"; from: 1; to: hintAnimation.maxGlow; duration: hintAnimation.duration }
268 StandardAnimation { target: hintGroup;
property: hintAnimation.prop; from: hintAnimation.endVal; to: 0; duration: hintAnimation.duration }
269 StandardAnimation { target: edgeHint;
property:
"size"; from: hintAnimation.maxGlow; to: 1; duration: hintAnimation.duration }