summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/clocks/content/Clock.qml5
-rwxr-xr-xexamples/declarative/clocks/content/clock-night.pngbin0 -> 23359 bytes
-rwxr-xr-xexamples/declarative/clocks/content/clock.pngbin21780 -> 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
new file mode 100755
index 0000000..cc7151a
--- /dev/null
+++ b/examples/declarative/clocks/content/clock-night.png
Binary files differ
diff --git a/examples/declarative/clocks/content/clock.png b/examples/declarative/clocks/content/clock.png
index 30bc577..462edac 100755
--- a/examples/declarative/clocks/content/clock.png
+++ b/examples/declarative/clocks/content/clock.png
Binary files differ