summaryrefslogtreecommitdiff
path: root/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml
diff options
context:
space:
mode:
Diffstat (limited to 'metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml')
-rw-r--r--metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml42
1 files changed, 35 insertions, 7 deletions
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()
}
}