diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2013-05-06 01:11:40 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2013-05-06 01:11:40 +0200 |
commit | d83093df7602aa2896de71292b47948540c22a44 (patch) | |
tree | 5f0b2c86f8a75124aaa4ae03547ec8b9f4bc4376 /metawatchwatchlets/metawatch-digital-watchface.qml | |
parent | 12cf6df3f1c90c6ccbab398f0ae03c946e4af638 (diff) | |
download | sowatch-d83093df7602aa2896de71292b47948540c22a44.tar.gz sowatch-d83093df7602aa2896de71292b47948540c22a44.zip |
metawatch watchface in QML still a work in progress
Diffstat (limited to 'metawatchwatchlets/metawatch-digital-watchface.qml')
-rw-r--r-- | metawatchwatchlets/metawatch-digital-watchface.qml | 123 |
1 files changed, 119 insertions, 4 deletions
diff --git a/metawatchwatchlets/metawatch-digital-watchface.qml b/metawatchwatchlets/metawatch-digital-watchface.qml index 712dbeb..23236a6 100644 --- a/metawatchwatchlets/metawatch-digital-watchface.qml +++ b/metawatchwatchlets/metawatch-digital-watchface.qml @@ -1,8 +1,9 @@ import QtQuick 1.0 +import com.javispedro.sowatch 1.0 import com.javispedro.sowatch.metawatch 1.0 MWPage { - // Remember that firmware draws top 30 lines + id: page Connections { target: watch @@ -11,8 +12,122 @@ MWPage { } } - MWLabel { - anchors.centerIn: parent - text: "This is a test" + Column { + Item { + id: systemArea + // Firmware draws top 30 lines; + // ensure we do not draw anything on top + width: page.width + height: 30 + } + + Image { + width: page.width + height: 2 + source: "idle_border.png" + } + + Item { + width: page.width + height: 30 + } + + Image { + width: page.width + height: 2 + source: "idle_border.png" + } + + Item { + width: page.width + height: 2 + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter + height: 30 + spacing: 8 + Column { + spacing: 4 + Image { + width: 24 + height: 18 + source: "idle_call.png" + } + Text { + id: labelCalls + anchors.horizontalCenter: parent.horizontalCenter + font.family: "MetaWatch Large caps 8pt" + font.pixelSize: 8 + text: "0" + } + } + Column { + spacing: 2 + Image { + width: 24 + height: 18 + source: "idle_msg.png" + } + Text { + id: labelMsgs + anchors.horizontalCenter: parent.horizontalCenter + font.family: "MetaWatch Large caps 8pt" + font.pixelSize: 8 + text: "0" + } + } + Column { + spacing: 2 + Image { + width: 24 + height: 18 + source: "idle_mail.png" + } + Text { + id: labelMails + anchors.horizontalCenter: parent.horizontalCenter + font.family: "MetaWatch Large caps 8pt" + font.pixelSize: 8 + text: "0" + } + } + } + } + + function updateUnreadCounts() { + labelCalls.text = notifications.fullCountByType(Notification.MissedCallNotification); + labelMsgs.text = notifications.fullCountByType(Notification.SmsNotification) + + notifications.fullCountByType(Notification.MmsNotification) + + notifications.fullCountByType(Notification.ImNotification); + labelMails.text = notifications.fullCountByType(Notification.EmailNotification); + console.log("unread mails = " + labelMails.text); + } + + function updateWeather() { + var weather = notifications.getMostRecentByType(Notification.WeatherNotification); + if (typeof weather !== "undefined") { + // TODO + } + } + + function update() { + updateUnreadCounts(); + updateWeather(); + } + + Connections { + target: watch + onActiveChanged: { + if (watch.active) { + console.log("watchface active"); + //updateUnreadCounts(); + } + } + } + + Connections { + target: notifications + onModelChanged: update(); } } |