@@ -15,12 +15,12 @@
1515 */
1616
1717import QtQuick 2.4
18+import QtQuick.Layouts 1.2
1819import QtGraphicalEffects 1.0
1920import Ubuntu.Components 1.3
2021import Wizard 0.1
2122import Ubuntu.SystemSettings.TimeDate 1.0
2223import Utils 0.1 as Utils
23−import QtQuick.Window 2.2
2424import ".." as LocalComponents
2525
2626LocalComponents.Page {
@@ -77,17 +77,6 @@ LocalComponents.Page {
7777 id: timeDatePanel
7878 }
7979
80− TimeZoneModel {
81− id: tzModel
82− }
83−
84− TimeZoneFilterModel {
85− id: tzFilterModel
86− sourceModel: tzModel
87− filter: searchField.text
88− country: root.countryCode
89− }
90−
9180 Component.onCompleted: {
9281 if (tzList.count == 1) { // preselect the first (and only) TZ
9382 var tz = tzList.itemAt(0,0);
@@ -96,6 +85,7 @@ LocalComponents.Page {
9685 }
9786 }
9887
88+ tzFilterModel.filter = Qt.binding(function() { return searchField.text; });
9989 theme.palette.normal.backgroundText = "#cdcdcd";
10090 searchField.forceActiveFocus();
10191 }
@@ -113,7 +103,7 @@ LocalComponents.Page {
113103 Column {
114104 anchors.verticalCenter: parent.verticalCenter
115105 anchors.left: parent.left
116− anchors.leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
106+ anchors.leftMargin: staticMargin
117107 anchors.right: image.left
118108 anchors.rightMargin: units.gu(2)
119109
@@ -140,7 +130,7 @@ LocalComponents.Page {
140130 anchors {
141131 right: parent.right
142132 verticalCenter: parent.verticalCenter
143− rightMargin: column.anchors.rightMargin == 0 ? staticMargin : 0
133+ rightMargin: staticMargin
144134 }
145135 fillMode: Image.PreserveAspectFit
146136 height: units.gu(1.5)
@@ -162,8 +152,12 @@ LocalComponents.Page {
162152 }
163153 }
164154
165− Item {
166− id: column
155+ GridLayout {
156+ id: masterLayout
157+ columns: 2
158+ rows: 1
159+ flow: GridLayout.TopToBottom
160+ columnSpacing: units.gu(2)
167161 anchors {
168162 fill: content
169163 topMargin: units.gu(4)
@@ -171,62 +165,55 @@ LocalComponents.Page {
171165 rightMargin: desktopLook ? staticMargin : 0
172166 }
173167
174− LocalComponents.WizardTextField {
175− id: searchField
176− objectName: "tzFilter"
177− anchors.left: parent.left
178− anchors.right: !desktopLook ? parent.right : undefined
179− anchors.leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
180− anchors.rightMargin: column.anchors.rightMargin == 0 ? staticMargin : 0
181− placeholderText: i18n.tr("Enter your city")
182− inputMethodHints: Qt.ImhNoPredictiveText
183− onTextChanged: resetViews();
184− }
168+ ColumnLayout {
169+ anchors.left: desktopLook ? undefined : parent.left
170+ anchors.right: desktopLook ? undefined : parent.right
171+ Layout.fillWidth: !desktopLook
172+ Layout.fillHeight: true
185173
186− Rectangle {
187− id: divider
188− anchors.left: parent.left
189− anchors.right: !desktopLook ? parent.right : undefined
190− anchors.top: searchField.bottom
191− anchors.topMargin: units.gu(3)
192− height: units.dp(1)
193− color: dividerColor
194− visible: tzList.count > 0
195− }
196−
197− ListView {
198− id: tzList
199− objectName: "tzList"
200− clip: true
201− currentIndex: -1
202− snapMode: ListView.SnapToItem
174+ LocalComponents.WizardTextField {
175+ id: searchField
176+ objectName: "tzFilter"
177+ anchors.left: parent.left
178+ anchors.right: parent.right
179+ anchors.leftMargin: !desktopLook ? staticMargin : 0
180+ anchors.rightMargin: !desktopLook ? staticMargin : 0
181+ placeholderText: i18n.tr("Enter your city")
182+ inputMethodHints: Qt.ImhNoPredictiveText
183+ onTextChanged: resetViews();
184+ }
203185
204− anchors {
205− left: parent.left
206− right: !desktopLook ? parent.right : undefined
207− top: divider.bottom
208− bottom: parent.bottom
186+ Rectangle {
187+ Layout.fillWidth: true
188+ id: divider
189+ anchors.topMargin: units.gu(3)
190+ height: units.dp(1)
191+ color: dividerColor
192+ visible: tzList.count > 0
209193 }
210194
211− model: tzFilterModel
212− delegate: tzComponent
195+ ListView {
196+ Layout.fillHeight: true
197+ Layout.fillWidth: true
198+ id: tzList
199+ objectName: "tzList"
200+ clip: true
201+ currentIndex: -1
202+ model: tzFilterModel
203+ delegate: tzComponent
204+ }
213205 }
214206
215207 Item {
208+ Layout.fillWidth: desktopLook
209+ Layout.fillHeight: true
216210 id: mapContainer
217− visible: content.width > maximumContentWidth + map.width
211+ visible: desktopLook
218212 enabled: visible
219− anchors {
220− left: tzList.right
221− right: parent.right
222− top: parent.top
223− bottom: parent.bottom
224− leftMargin: units.gu(2)
225− }
226213
227214 Item {
228215 id: map
229− width: column.width - tzList.width
216+ width: parent.width
230217 height: width / 1.95 // keep our aspect ratio
231218 anchors {
232219 centerIn: parent