diff options
Diffstat (limited to 'weather-qml/Rain.qml')
-rw-r--r-- | weather-qml/Rain.qml | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/weather-qml/Rain.qml b/weather-qml/Rain.qml new file mode 100644 index 0000000..1774b2b --- /dev/null +++ b/weather-qml/Rain.qml @@ -0,0 +1,119 @@ +import Qt 4.6 + +ForecastView { + id: root + isClear: false + + SmallCloud { + id: cloud5 + x: scaledX(300) + y: scaledY(-800) + finalY: scaledY(-469); + type: "cloud_rain" + } + + HungItem { + id: sun + x: isDay ? scaledX(198) : scaledX(220) + y: scaledY(-800) + itemX: 0 + itemY: isDay ? 176 : 180 + height: isDay ? 460 : 440 + finalY: isDay ? scaledY(-255) : scaledY(-205) + itemImage: isDay ? "images/cold_sun.png" : "images/moon.png" + lineImage: isDay ? "images/cold_sun_line.png" : "images/moon_line.png" + } + + MediumCloud { + id: cloud4 + x: scaledX(100) + y: scaledY(-800) + finalY: scaledY(-356) + type: "cloud_rain" + } + + MediumCloud { + id: cloud3 + x: scaledX(340) + y: scaledY(-800) + finalY: scaledY(-339) + type: "cloud_rain" + } + + RainItem { + id: rain + x: scaledX(70) + y: scaledY(376) + visible: false + rainType: "rain" + } + + LargeCloud { + id: cloud2 + x: scaledX(186) + y: scaledY(-800) + finalY: scaledY(-319) + type: "cloud_rain" + } + + LargeCloud { + id: cloud1 + x: scaledX(-62) + y: scaledY(-800) + finalY: scaledY(-289) + type: "cloud_rain" + } + + states : State { + name: "final" + PropertyChanges { target: sun; y: sun.finalY; } + PropertyChanges { target: cloud1; y: cloud1.finalY; } + PropertyChanges { target: cloud2; y: cloud2.finalY; } + PropertyChanges { target: cloud3; y: cloud3.finalY; } + PropertyChanges { target: cloud4; y: cloud4.finalY; } + PropertyChanges { target: cloud5; y: cloud5.finalY; } + PropertyChanges { target: rain; visible: true; } + } + + transitions: Transition { + SequentialAnimation { + ParallelAnimation { + NumberAnimation { target: cloud1; properties: "y"; + easing.type: "OutBack"; duration: 500 } + + SequentialAnimation { + PauseAnimation { duration: 200 } + NumberAnimation { target: cloud2; properties: "y"; + easing.type: "OutBack"; duration: 500 } + } + + SequentialAnimation { + PauseAnimation { duration: 400 } + NumberAnimation { target: cloud3; properties: "y"; + easing.type: "OutBack"; duration: 500 } + } + + SequentialAnimation { + PauseAnimation { duration: 600 } + NumberAnimation { target: cloud4; properties: "y"; + easing.type: "OutBack"; duration: 500 } + } + + SequentialAnimation { + PauseAnimation { duration: 800 } + NumberAnimation { target: cloud5; properties: "y"; + easing.type: "OutBack"; duration: 500 } + } + } + + NumberAnimation { target: sun; properties: "y"; + easing.type: "OutBack"; duration: 500 } + + PauseAnimation { duration: 100 } + + NumberAnimation { target: rain; properties: "visible"; duration: 0 } + } + } + + onPresent: { root.state = "final"; } +} |