Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tools / qmlviewer / startup / Logo.qml
1 /****************************************************************************
2 **
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
6 **
7 ** This file is part of the QtDeclarative module of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** No Commercial Usage
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
14 ** this package.
15 **
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file.  Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23 **
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27 **
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
30 **
31 **
32 **
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 import QtQuick 1.0
43
44 Rectangle {
45     id: myApp
46     width: 411
47     height: 411
48     color: "transparent"
49     property alias logoState : myApp.state
50     signal animationFinished
51
52     Item {
53         id: sketchBlueHolder
54         width: sketchLogo.width
55         height: sketchLogo.height
56         Image {
57             id: image1
58             x: -44
59             y: -45
60             smooth: true
61             source: "shadow.png"
62         }
63         Item {
64             clip: true
65             width: sketchLogo.width
66             height: sketchLogo.height
67             Image {
68                 id: sketchLogo
69                 smooth: true
70                 source: "qt-sketch.jpg"
71             }
72             Image {
73                 id: blueLogo
74                 y: -420
75                 smooth: true
76                 source: "qt-blue.jpg"
77             }
78         }
79     }
80
81     states: [
82         State {
83             name: "showBlueprint"
84             PropertyChanges {
85                 target: blueLogo
86                 y: 0
87             }
88             PropertyChanges {
89                 target: sketchLogo
90                 opacity: 0
91             }
92         },
93         State {
94             extend: "showBlueprint"
95             name: "finale"
96             PropertyChanges {
97                 target: fullLogo
98                 opacity: 1
99             }
100             PropertyChanges {
101                 target: backLogo
102                 opacity: 1
103                 scale: 1
104             }
105             PropertyChanges {
106                 target: frontLogo
107                 opacity: 1
108                 scale: 1
109             }
110             PropertyChanges {
111                 target: qtText
112                 opacity: 1
113                 scale: 1
114             }
115             PropertyChanges {
116                 target: sketchBlueHolder
117                 opacity: 0
118                 scale: 1.4
119             }
120         }
121     ]
122
123     transitions: [
124         Transition {
125             to: "showBlueprint"
126             SequentialAnimation {
127                 NumberAnimation { property: "y"; duration: 600; easing.type: "OutBounce" }
128                 PropertyAction { target: sketchLogo; property: "opacity" }
129             }
130         },
131         Transition {
132             to: "finale"
133             PropertyAction { target: fullLogo; property: "opacity" }
134             SequentialAnimation {
135                 NumberAnimation { target: backLogo; properties: "scale, opacity"; duration: 300 }
136                 NumberAnimation { target: frontLogo; properties: "scale, opacity"; duration: 300 }
137                 ParallelAnimation {
138                     NumberAnimation { target: qtText; properties: "opacity, scale"; duration: 400; easing.type: "OutQuad" }
139                     NumberAnimation { target: sketchBlueHolder; property: "opacity"; duration: 300; easing.type: "OutQuad" }
140                     NumberAnimation { target: sketchBlueHolder; property: "scale"; duration: 320; easing.type: "OutQuad" }
141                 }
142                 PauseAnimation { duration: 1000 }
143                 ScriptAction { script: myApp.animationFinished() }
144             }
145         }
146     ]
147
148     Item {
149         id: fullLogo
150         opacity: 0
151         Image {
152             id: backLogo
153             x: -16
154             y: -41
155             opacity: 0
156             scale: 0.7
157             smooth: true
158             source: "qt-back.png"
159         }
160         Image {
161             id: frontLogo
162             x: -17
163             y: -41
164             opacity: 0
165             scale: 1.2
166             smooth: true
167             source: "qt-front.png"
168         }
169         Image {
170             id: qtText
171             x: -10
172             y: -41
173             opacity: 0
174             scale: 1.2
175             smooth: true
176             source: "qt-text.png"
177         }
178     }
179 }