on xenial help sign in
Don't undo clock date label binding, rather just force it to regenerate itself
c584e65Michael Terry
qml/Greeter/Clock.qml+10−10
@@ -34,6 +34,16 @@ Item {
34 }
34 }
35 }
35 }
36
36
37+ Connections {
38+ target: i18n
39+ onLanguageChanged: {
40+ if (visible) {
41+ timeLabel.text = Qt.formatTime(clock.currentDate); // kicks time
42+ clock.currentDate = new Date(); // kicks date
43+ }
44+ }
45+ }
46+
37 Indicators.SharedUnityMenuModel {
47 Indicators.SharedUnityMenuModel {
38 id: timeModel
48 id: timeModel
39 objectName: "timeModel"
49 objectName: "timeModel"
@@ -66,11 +76,6 @@ Item {
66 opacity: 0.5
76 opacity: 0.5
67 text: Qt.formatTime(clock.currentDate)
77 text: Qt.formatTime(clock.currentDate)
68 font.weight: Font.Light
78 font.weight: Font.Light
69−
70− Connections {
71− target: i18n
72− onLanguageChanged: timeLabel.text = Qt.formatTime(clock.currentDate)
73− }
74 }
79 }
75
80
76 Label {
81 Label {
@@ -83,11 +88,6 @@ Item {
83 opacity: 0.5
88 opacity: 0.5
84 text: Qt.formatDate(clock.currentDate, Qt.DefaultLocaleLongDate)
89 text: Qt.formatDate(clock.currentDate, Qt.DefaultLocaleLongDate)
85 font.weight: Font.Light
90 font.weight: Font.Light
86−
87− Connections {
88− target: i18n
89− onLanguageChanged: dateLabel.text = Qt.formatDate(clock.currentDate, Qt.DefaultLocaleLongDate)
90− }
91 }
91 }
92 }
92 }
93}
93}