on xenial help sign in
map tablet mode
55783e0Lukáš Tinkl
qml/Wizard/Pages/50-timezone.qml+90−84
@@ -154,107 +154,113 @@ LocalComponents.Page {
154 }
154 }
155 }
155 }
156
156
157− GridLayout {
157+
158− id: masterLayout
158+ ColumnLayout {
159− columns: 2
159+ id: leftColumn
160− rows: 1
161− flow: GridLayout.TopToBottom
162− columnSpacing: units.gu(2)
163 anchors {
160 anchors {
161+ left: content.left
164− fill: content
162+ top: content.top
163+ bottom: content.bottom
164+ right: !desktopLook ? content.right : undefined
165 leftMargin: desktopLook ? staticMargin : 0
165 leftMargin: desktopLook ? staticMargin : 0
166 rightMargin: desktopLook ? staticMargin : 0
166 rightMargin: desktopLook ? staticMargin : 0
167 topMargin: customMargin
167 topMargin: customMargin
168 }
168 }
169
169
170− ColumnLayout {
170+ width: Math.min(parent.width, units.gu(34))
171− Layout.fillHeight: true
172− Layout.maximumWidth: maximumContentWidth
173
171
174− LocalComponents.WizardTextField {
172+ LocalComponents.WizardTextField {
175− id: searchField
173+ id: searchField
176− objectName: "tzFilter"
174+ objectName: "tzFilter"
177− anchors.left: parent.left
175+ anchors.left: parent.left
178− anchors.right: parent.right
176+ anchors.right: parent.right
179− anchors.leftMargin: !desktopLook ? staticMargin : 0
177+ anchors.leftMargin: !desktopLook ? staticMargin : 0
180− anchors.rightMargin: !desktopLook ? staticMargin : 0
178+ anchors.rightMargin: !desktopLook ? staticMargin : 0
181− placeholderText: i18n.tr("Enter your city")
179+ placeholderText: i18n.tr("Enter your city")
182− inputMethodHints: Qt.ImhNoPredictiveText
180+ inputMethodHints: Qt.ImhNoPredictiveText
183− onTextChanged: resetViews();
181+ onTextChanged: resetViews();
184− }
182+ }
185
183
186− ListView {
184+ ListView {
187− Layout.fillHeight: true
185+ Layout.fillHeight: true
188− Layout.fillWidth: true
186+ Layout.fillWidth: true
189− id: tzList
187+ id: tzList
190− objectName: "tzList"
188+ objectName: "tzList"
191− clip: true
189+ clip: true
192− currentIndex: -1
190+ currentIndex: -1
193− model: TimeZoneModel {
191+ model: TimeZoneModel {
194− id: timeZoneModel
192+ id: timeZoneModel
195− filter: searchField.text
193+ filter: searchField.text
196− country: i18n.language.split('_')[1].split('.')[0]
194+ country: i18n.language.split('_')[1].split('.')[0]
197− }
198− delegate: tzComponent
199 }
195 }
196+ delegate: tzComponent
197+ }
200
198
201− ActivityIndicator {
199+ ActivityIndicator {
202− anchors.centerIn: tzList
200+ anchors.centerIn: tzList
203− running: tzList.count == 0 &&
201+ running: tzList.count == 0 &&
204− searchField.length > 0 &&
202+ searchField.length > 0 &&
205− timeZoneModel.listUpdating
203+ timeZoneModel.listUpdating
206− visible: running
204+ visible: running
207− }
205+ }
206+ }
207+
208+ Item {
209+ id: mapContainer
210+ visible: desktopLook && !contentAnimationRunning
211+ enabled: visible
212+
213+ anchors {
214+ left: leftColumn.right
215+ leftMargin: units.gu(2)
216+ right: content.right
217+ rightMargin: staticMargin
218+ top: content.top
219+ topMargin: customMargin
220+ bottom: parent.bottom
221+ bottomMargin: buttonBarHeight
208 }
222 }
209
223
210 Item {
224 Item {
211− Layout.fillWidth: desktopLook
212− Layout.fillHeight: true
213− id: mapContainer
214− visible: desktopLook && !contentAnimationRunning
215− enabled: visible
216−
217− Item {
218− id: map
225+ id: map
219− width: Math.min(parent.width, height * 1.95) // keep our aspect ratio
226+ width: Math.min(parent.width, height * 1.95) // keep our aspect ratio
220− height: parent.height
227+ height: parent.height
221− anchors {
228+ anchors {
222− centerIn: parent
229+ centerIn: parent
223− }
230+ }
224
231
225− Image {
232+ Image {
226− id: backgroundImage
233+ id: backgroundImage
227− source: "data/timezonemap/map.png"
234+ source: "data/timezonemap/map.png"
228− sourceSize: Qt.size(map.width, map.height)
235+ sourceSize: Qt.size(map.width, map.height)
229− fillMode: Image.PreserveAspectFit
236+ fillMode: Image.PreserveAspectFit
230− smooth: false
237+ smooth: false
231− visible: false
238+ visible: false
232− asynchronous: true
239+ asynchronous: true
233− }
240+ }
234
241
235− Image {
242+ Image {
236− id: highlightImage
243+ id: highlightImage
237− sourceSize: Qt.size(map.width, map.height)
244+ sourceSize: Qt.size(map.width, map.height)
238− fillMode: Image.PreserveAspectFit
245+ fillMode: Image.PreserveAspectFit
239− smooth: false
246+ smooth: false
240− visible: false
247+ visible: false
241− asynchronous: true
248+ asynchronous: true
242− }
249+ }
243
250
244− Blend {
251+ Blend {
245− anchors.fill: map
252+ anchors.fill: map
246− source: backgroundImage
253+ source: backgroundImage
247− foregroundSource: highlightImage
254+ foregroundSource: highlightImage
248− }
255+ }
249
256
250− Image {
257+ Image {
251− id: pinImage
258+ id: pinImage
252− source: "data/timezonemap/pin.png"
259+ source: "data/timezonemap/pin.png"
253− visible: x != 0 && y != 0
260+ visible: x != 0 && y != 0
254− width: units.dp(12)
261+ width: units.dp(12)
255− height: units.dp(20)
262+ height: units.dp(20)
256− z: map.z + 1
263+ z: map.z + 1
257− }
258 }
264 }
259 }
265 }
260 }
266 }