~josephjamesmills/ubuntutv/fan_art

« back to all changes in this revision

Viewing changes to shell/weather/forecasts/Fog.qml

  • Committer: Joseph Mills
  • Date: 2012-07-28 14:57:10 UTC
  • Revision ID: josephjamesmills@gmail.com-20120728145710-sy00cvq1ja8o9qad
Lots of cool stuff. watch my youtube videos to see  what else has been added

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** This file is part of Qt Media Hub**
 
2
 
 
3
Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).*
 
4
All rights reserved.
 
5
 
 
6
Contact:  Nokia Corporation qmh-development@qt-project.org
 
7
 
 
8
You may use this file under the terms of the BSD license
 
9
as follows:
 
10
 
 
11
Redistribution and use in source and binary forms, with or
 
12
without modification, are permitted provided that the following
 
13
conditions are met:
 
14
* Redistributions of source code must retain the above copyright
 
15
notice, this list of conditions and the following disclaimer.
 
16
 
 
17
* Redistributions in binary form must reproduce the above copyright
 
18
notice, this list of conditions and the following disclaimer in the
 
19
documentation and/or other materials provided with the distribution.
 
20
 
 
21
* Neither the name of Nokia Corporation and its Subsidiary(-ies)
 
22
nor the names of its contributors may be used to endorse or promote
 
23
products derived from this software without specific prior
 
24
written permission.
 
25
 
 
26
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
27
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
28
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 
29
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 
30
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 
31
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 
32
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 
33
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 
34
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 
35
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
36
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 
37
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. **/
 
38
 
 
39
import Qt 4.7
 
40
import "elements"
 
41
import "../"
 
42
 
 
43
ForecastView {
 
44
    id: root
 
45
    isClear: false
 
46
 
 
47
    SmallCloud {
 
48
        id: cloud2
 
49
        x: translateX(308)
 
50
        y: translateY(-800)
 
51
        finalY: translateY(-468);
 
52
        type: "cloud_rain"
 
53
    }
 
54
 
 
55
    HungItem {
 
56
        id: sun
 
57
        x: isDay ? translateX(198) : translateX(220)
 
58
        y: translateY(-800)
 
59
        itemX: 0
 
60
        itemY:  isDay ? 176 : 180
 
61
        height:  isDay ? 460 : 440
 
62
        finalY: isDay ? translateY(-255) : translateY(-205)
 
63
        itemImage: isDay ? folder + "cold_sun.png" : folder + "moon.png"
 
64
        lineImage: isDay ? folder + "cold_sun_line.png" : folder + "moon_line.png"
 
65
    }
 
66
 
 
67
    MediumCloud {
 
68
        id: cloud1
 
69
        x: translateX(3)
 
70
        y: translateY(-800)
 
71
        finalY: translateY(-296)
 
72
        type: "cloud_rain"
 
73
    }
 
74
 
 
75
    Image {
 
76
        id: fog
 
77
        source: "../" + folder + "fog.png"
 
78
        anchors.fill: parent
 
79
        anchors.leftMargin: 50
 
80
        anchors.rightMargin: 50
 
81
    }
 
82
 
 
83
    states : State {
 
84
        name: "final"
 
85
        PropertyChanges { target: sun; y: sun.finalY; }
 
86
        PropertyChanges { target: cloud1; y: cloud1.finalY; }
 
87
        PropertyChanges { target: cloud2; y: cloud2.finalY; }
 
88
    }
 
89
 
 
90
    transitions: Transition {
 
91
        SequentialAnimation {
 
92
            ParallelAnimation {
 
93
               NumberAnimation { target: cloud1; properties: "y";
 
94
                                 easing.type: "OutBack"; duration: 500 }
 
95
 
 
96
               SequentialAnimation {
 
97
                   PauseAnimation { duration: 200 }
 
98
                   NumberAnimation { target: cloud2; properties: "y";
 
99
                                     easing.type: "OutBack"; duration: 500 }
 
100
               }
 
101
            }
 
102
 
 
103
            NumberAnimation { target: sun; properties: "y";
 
104
                              easing.type: "OutBack"; duration: 500 }
 
105
        }
 
106
    }
 
107
 
 
108
    onPresent: { root.state = "final"; }
 
109
}