18 import Ubuntu.Components 0.1
19 import Unity.Indicators 0.1 as Indicators
24 implicitWidth: childrenRect.width
25 implicitHeight: childrenRect.height
28 property date currentDate
31 property bool active: clock.enabled && clock.visible
33 Component.onCompleted: {
35 currentDate =
new Date()
39 Indicators.CachedUnityMenuModel {
41 objectName:
"timeModel"
43 busName:
"com.canonical.indicator.datetime"
44 actionsObjectPath:
"/com/canonical/indicator/datetime"
45 menuObjectPath: clock.active ?
"/com/canonical/indicator/datetime/phone" :
""
47 Indicators.RootActionState {
50 if (timeLabel.text != rightLabel) {
51 timeLabel.text = rightLabel;
52 clock.currentDate =
new Date();
59 spacing: units.gu(0.5)
63 objectName:
"timeLabel"
65 anchors.horizontalCenter: parent.horizontalCenter
66 font.pixelSize: units.gu(7.5)
69 text: Qt.formatTime(clock.currentDate)
70 font.weight: Font.Light
75 objectName:
"dateLabel"
77 anchors.horizontalCenter: parent.horizontalCenter
81 text: Qt.formatDate(clock.currentDate, Qt.DefaultLocaleLongDate)
82 font.weight: Font.Light