@@ -65,6 +65,14 @@ LocalComponents.Page {
6565 return y;
6666 }
6767
68+ function resetViews() {
69+ selectedTimeZone = ""
70+ tzList.currentIndex = -1
71+ highlightImage.source = ""
72+ pinImage.x = 0;
73+ pinImage.y = 0;
74+ }
75+
6876 UbuntuTimeDatePanel {
6977 id: timeDatePanel
7078 }
@@ -171,12 +179,7 @@ LocalComponents.Page {
171179 anchors.rightMargin: column.anchors.rightMargin == 0 ? staticMargin : 0
172180 placeholderText: i18n.tr("Enter your city")
173181 inputMethodHints: Qt.ImhNoPredictiveText
174− onTextChanged: {
175− // reset when switching between filter modes (text/country)
176− selectedTimeZone = ""
177− tzList.currentIndex = -1
178− highlightImage.source = ""
179− }
182+ onTextChanged: resetViews();
180183 }
181184
182185 Rectangle {
@@ -216,12 +219,15 @@ LocalComponents.Page {
216219 right: parent.right
217220 top: parent.top
218221 bottom: parent.bottom
222+ leftMargin: units.gu(2)
219223 }
220224
221225 Item {
222226 id: map
223− width: units.dp(800)
224− height: units.dp(410)
227+ //width: units.dp(800)
228+ //height: units.dp(410)
229+ width: column.width - tzList.width
230+ height: width / 1.95
225231 anchors {
226232 centerIn: parent
227233 }
@@ -229,13 +235,16 @@ LocalComponents.Page {
229235 MouseArea {
230236 anchors.fill: parent
231237 onClicked: {
232− print("Clicked at", mouse.x, mouse.y)
233− print("Map size:", map.width, map.height)
234238 var tzAndOffset = tzModel.timezoneAndOffsetAtMapPoint(mouse.x, mouse.y,
235239 Qt.size(map.width, map.height));
236240 var tzId = tzAndOffset[0];
237241 var offset = tzAndOffset[1];
238242 print("Timezone", tzId, ", offset", offset);
243+ if (tzId) {
244+ resetViews();
245+ selectedTimeZone = tzId;
246+ highlightTimezone(offset);
247+ }
239248 }
240249 }
241250
@@ -266,7 +275,7 @@ LocalComponents.Page {
266275 Image {
267276 id: pinImage
268277 source: "data/timezonemap/pin.png"
269− visible: selectedTimeZone != ""
278+ visible: x != 0 && y != 0
270279 width: units.dp(8)
271280 height: units.dp(16)
272281 z: map.z + 1