@@ -65,6 +65,14 @@ LocalComponents.Page {
68+ function resetViews() {
69+ selectedTimeZone = ""
70+ tzList.currentIndex = -1
71+ highlightImage.source = ""
68 UbuntuTimeDatePanel {
76 UbuntuTimeDatePanel {
69 id: timeDatePanel
77 id: timeDatePanel
@@ -171,12 +179,7 @@ LocalComponents.Page {
171 anchors.rightMargin: column.anchors.rightMargin == 0 ? staticMargin : 0
179 anchors.rightMargin: column.anchors.rightMargin == 0 ? staticMargin : 0
172 placeholderText: i18n.tr("Enter your city")
180 placeholderText: i18n.tr("Enter your city")
173 inputMethodHints: Qt.ImhNoPredictiveText
181 inputMethodHints: Qt.ImhNoPredictiveText
174− onTextChanged: {
182+ onTextChanged: resetViews();
175− // reset when switching between filter modes (text/country)
176− selectedTimeZone = ""
177− tzList.currentIndex = -1
178− highlightImage.source = ""
182 Rectangle {
185 Rectangle {
@@ -216,12 +219,15 @@ LocalComponents.Page {
216 right: parent.right
219 right: parent.right
217 top: parent.top
220 top: parent.top
218 bottom: parent.bottom
221 bottom: parent.bottom
222+ leftMargin: units.gu(2)
223− width: units.dp(800)
227+ //width: units.dp(800)
224− height: units.dp(410)
228+ //height: units.dp(410)
229+ width: column.width - tzList.width
230+ height: width / 1.95
225 anchors {
231 anchors {
226 centerIn: parent
232 centerIn: parent
@@ -229,13 +235,16 @@ LocalComponents.Page {
229 MouseArea {
235 MouseArea {
230 anchors.fill: parent
236 anchors.fill: parent
231 onClicked: {
237 onClicked: {
232− print("Clicked at", mouse.x, mouse.y)
233− print("Map size:", map.width, map.height)
234 var tzAndOffset = tzModel.timezoneAndOffsetAtMapPoint(mouse.x, mouse.y,
238 var tzAndOffset = tzModel.timezoneAndOffsetAtMapPoint(mouse.x, mouse.y,
235 Qt.size(map.width, map.height));
239 Qt.size(map.width, map.height));
236 var tzId = tzAndOffset[0];
240 var tzId = tzAndOffset[0];
237 var offset = tzAndOffset[1];
241 var offset = tzAndOffset[1];
238 print("Timezone", tzId, ", offset", offset);
242 print("Timezone", tzId, ", offset", offset);
245+ selectedTimeZone = tzId;
246+ highlightTimezone(offset);
@@ -266,7 +275,7 @@ LocalComponents.Page {
267 id: pinImage
276 id: pinImage
268 source: "data/timezonemap/pin.png"
277 source: "data/timezonemap/pin.png"
269− visible: selectedTimeZone != ""
278+ visible: x != 0 && y != 0
270 width: units.dp(8)
279 width: units.dp(8)
271 height: units.dp(16)
280 height: units.dp(16)
272 z: map.z + 1
281 z: map.z + 1