diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2009-11-02 04:33:53 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2009-11-02 04:33:53 (GMT) |
commit | 3dd28725a32c5eae6fa05c2bbe309c7919671cdc (patch) | |
tree | 8179f7ec2ac3437388a7c4753f1654894ed2bca2 /examples/declarative/clocks | |
parent | 1795271ac03a8662ff0eac153c63c3d562f91921 (diff) | |
download | Qt-3dd28725a32c5eae6fa05c2bbe309c7919671cdc.zip Qt-3dd28725a32c5eae6fa05c2bbe309c7919671cdc.tar.gz Qt-3dd28725a32c5eae6fa05c2bbe309c7919671cdc.tar.bz2 |
add night support for clocks example
Diffstat (limited to 'examples/declarative/clocks')
-rw-r--r-- | examples/declarative/clocks/content/Clock.qml | 5 | ||||
-rwxr-xr-x | examples/declarative/clocks/content/clock-night.png | bin | 0 -> 23359 bytes | |||
-rwxr-xr-x | examples/declarative/clocks/content/clock.png | bin | 21780 -> 20653 bytes |
3 files changed, 4 insertions, 1 deletions
diff --git a/examples/declarative/clocks/content/Clock.qml b/examples/declarative/clocks/content/Clock.qml index 2aac5f1..0c6836f 100644 --- a/examples/declarative/clocks/content/Clock.qml +++ b/examples/declarative/clocks/content/Clock.qml @@ -9,10 +9,12 @@ Item { property var minutes property var seconds property var shift : 0 + property bool night: false function timeChanged() { var date = new Date; hours = shift ? date.getUTCHours() + Math.floor(clock.shift) : date.getHours() + if ( hours < 7 || hours > 19 ) night = true; else night = false minutes = shift ? date.getUTCMinutes() + ((clock.shift % 1) * 60) : date.getMinutes() seconds = date.getUTCSeconds(); } @@ -22,7 +24,8 @@ Item { onTriggered: clock.timeChanged() } - Image { id: background; source: "clock.png" } + Image { id: background; source: "clock.png"; visible: clock.night == false } + Image { source: "clock-night.png"; visible: clock.night == true } Image { x: 92.5; y: 27 diff --git a/examples/declarative/clocks/content/clock-night.png b/examples/declarative/clocks/content/clock-night.png Binary files differnew file mode 100755 index 0000000..cc7151a --- /dev/null +++ b/examples/declarative/clocks/content/clock-night.png diff --git a/examples/declarative/clocks/content/clock.png b/examples/declarative/clocks/content/clock.png Binary files differindex 30bc577..462edac 100755 --- a/examples/declarative/clocks/content/clock.png +++ b/examples/declarative/clocks/content/clock.png |