@@ -15,12 +15,12 @@
17import QtQuick 2.4
17import QtQuick 2.4
18+import QtQuick.Layouts 1.2
18import QtGraphicalEffects 1.0
19import QtGraphicalEffects 1.0
19import Ubuntu.Components 1.3
20import Ubuntu.Components 1.3
20import Wizard 0.1
21import Wizard 0.1
21import Ubuntu.SystemSettings.TimeDate 1.0
22import Ubuntu.SystemSettings.TimeDate 1.0
22import Utils 0.1 as Utils
23import Utils 0.1 as Utils
23−import QtQuick.Window 2.2
24import ".." as LocalComponents
24import ".." as LocalComponents
26LocalComponents.Page {
26LocalComponents.Page {
@@ -77,17 +77,6 @@ LocalComponents.Page {
77 id: timeDatePanel
77 id: timeDatePanel
84− TimeZoneFilterModel {
87− filter: searchField.text
88− country: root.countryCode
91 Component.onCompleted: {
80 Component.onCompleted: {
92 if (tzList.count == 1) { // preselect the first (and only) TZ
81 if (tzList.count == 1) { // preselect the first (and only) TZ
93 var tz = tzList.itemAt(0,0);
82 var tz = tzList.itemAt(0,0);
@@ -96,6 +85,7 @@ LocalComponents.Page {
88+ tzFilterModel.filter = Qt.binding(function() { return searchField.text; });
99 theme.palette.normal.backgroundText = "#cdcdcd";
89 theme.palette.normal.backgroundText = "#cdcdcd";
100 searchField.forceActiveFocus();
90 searchField.forceActiveFocus();
@@ -113,7 +103,7 @@ LocalComponents.Page {
114 anchors.verticalCenter: parent.verticalCenter
104 anchors.verticalCenter: parent.verticalCenter
115 anchors.left: parent.left
105 anchors.left: parent.left
116− anchors.leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
106+ anchors.leftMargin: staticMargin
117 anchors.right: image.left
107 anchors.right: image.left
118 anchors.rightMargin: units.gu(2)
108 anchors.rightMargin: units.gu(2)
@@ -140,7 +130,7 @@ LocalComponents.Page {
140 anchors {
130 anchors {
141 right: parent.right
131 right: parent.right
142 verticalCenter: parent.verticalCenter
132 verticalCenter: parent.verticalCenter
143− rightMargin: column.anchors.rightMargin == 0 ? staticMargin : 0
133+ rightMargin: staticMargin
145 fillMode: Image.PreserveAspectFit
135 fillMode: Image.PreserveAspectFit
146 height: units.gu(1.5)
136 height: units.gu(1.5)
@@ -162,8 +152,12 @@ LocalComponents.Page {
165− Item {
155+ GridLayout {
166− id: column
156+ id: masterLayout
159+ flow: GridLayout.TopToBottom
160+ columnSpacing: units.gu(2)
167 anchors {
161 anchors {
168 fill: content
162 fill: content
169 topMargin: units.gu(4)
163 topMargin: units.gu(4)
@@ -171,62 +165,55 @@ LocalComponents.Page {
171 rightMargin: desktopLook ? staticMargin : 0
165 rightMargin: desktopLook ? staticMargin : 0
174− LocalComponents.WizardTextField {
168+ ColumnLayout {
175− id: searchField
169+ anchors.left: desktopLook ? undefined : parent.left
176− objectName: "tzFilter"
177− anchors.left: parent.left
170+ anchors.right: desktopLook ? undefined : parent.right
178− anchors.right: !desktopLook ? parent.right : undefined
171+ Layout.fillWidth: !desktopLook
179− anchors.leftMargin: column.anchors.leftMargin == 0 ? staticMargin : 0
172+ Layout.fillHeight: true
180− anchors.rightMargin: column.anchors.rightMargin == 0 ? staticMargin : 0
181− placeholderText: i18n.tr("Enter your city")
182− inputMethodHints: Qt.ImhNoPredictiveText
183− onTextChanged: resetViews();
186− Rectangle {
174+ LocalComponents.WizardTextField {
188− anchors.left: parent.left
189− anchors.right: !desktopLook ? parent.right : undefined
190− anchors.top: searchField.bottom
175+ id: searchField
191− anchors.topMargin: units.gu(3)
176+ objectName: "tzFilter"
192− height: units.dp(1)
177+ anchors.left: parent.left
193− color: dividerColor
178+ anchors.right: parent.right
194− visible: tzList.count > 0
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();
199− objectName: "tzList"
202− snapMode: ListView.SnapToItem
204− anchors {
186+ Rectangle {
205− left: parent.left
187+ Layout.fillWidth: true
206− right: !desktopLook ? parent.right : undefined
207− top: divider.bottom
188+ id: divider
208− bottom: parent.bottom
189+ anchors.topMargin: units.gu(3)
192+ visible: tzList.count > 0
196+ Layout.fillHeight: true
197+ Layout.fillWidth: true
199+ objectName: "tzList"
211− model: tzFilterModel
202+ model: tzFilterModel
212− delegate: tzComponent
203+ delegate: tzComponent
208+ Layout.fillWidth: desktopLook
209+ Layout.fillHeight: true
216 id: mapContainer
210 id: mapContainer
217− visible: content.width > maximumContentWidth + map.width
211+ visible: desktopLook
218 enabled: visible
212 enabled: visible
223− bottom: parent.bottom
224− leftMargin: units.gu(2)
229− width: column.width - tzList.width
216+ width: parent.width
230 height: width / 1.95 // keep our aspect ratio
217 height: width / 1.95 // keep our aspect ratio
231 anchors {
218 anchors {
232 centerIn: parent
219 centerIn: parent