diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2013-05-03 21:13:31 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2013-05-03 21:13:31 +0200 |
commit | 9e061170b3834845910749c55eda63f03d982bbf (patch) | |
tree | 0837bbdb63918eaf07333a81a98a21646d5ac3c6 /metawatch/qml | |
parent | fba422cb3999e5c1a35849891861faa24494bd50 (diff) | |
download | sowatch-9e061170b3834845910749c55eda63f03d982bbf.tar.gz sowatch-9e061170b3834845910749c55eda63f03d982bbf.zip |
add a small status bar to metawatch watchlets
Diffstat (limited to 'metawatch/qml')
-rw-r--r-- | metawatch/qml/com/javispedro/sowatch/metawatch/MWLabel.qml | 2 | ||||
-rw-r--r-- | metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml | 42 |
2 files changed, 36 insertions, 8 deletions
diff --git a/metawatch/qml/com/javispedro/sowatch/metawatch/MWLabel.qml b/metawatch/qml/com/javispedro/sowatch/metawatch/MWLabel.qml index 3ce64ca..5bf8ff1 100644 --- a/metawatch/qml/com/javispedro/sowatch/metawatch/MWLabel.qml +++ b/metawatch/qml/com/javispedro/sowatch/metawatch/MWLabel.qml @@ -2,5 +2,5 @@ import Qt 4.7 Text { font.family: "MetaWatch Large 16pt" - font.pointSize: 10.5 + font.pixelSize: 14 } diff --git a/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml b/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml index b87d535..b5ad787 100644 --- a/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml +++ b/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml @@ -1,24 +1,52 @@ import Qt 4.7 +import com.javispedro.sowatch 1.0 Rectangle { width: 96 - height: 16 + height: time.height + (title.visible ? 16 : 0) - property alias text: label.text - property alias font: label.font + property alias text: title.text + property alias font: title.font property alias icon: image + clip: true + Image { id: image + anchors.top: time.bottom anchors.left: parent.left - anchors.top: parent.top } MWLabel { - id: label + id: title + anchors.top: time.bottom anchors.left: image.right anchors.leftMargin: 2 - anchors.verticalCenter: parent.verticalCenter - font.pointSize: 12 + font.pixelSize: 16 + visible: text != "" + } + + MWLabel { + id: time + anchors.right: parent.right + anchors.rightMargin: 1 + anchors.top: parent.top + height: 8 + font.family: "MetaWatch Large caps 8pt" + font.pixelSize: 8 + text: " : " + } + + function updateStatusBar() { + var now = new Date + time.text = Qt.formatDate(now, "ddd") + " " + Qt.formatTime(now) + } + + Timer { + triggeredOnStart: true + interval: 100000 + repeat: true + running: watch.active + onTriggered: updateStatusBar() } } |