on xenial help sign in
optimize the resource heavy TZ page some more
f3fd679Lukáš Tinkl
qml/Wizard/Page.qml+1
@@ -21,6 +21,7 @@ import Wizard 0.1
21Item {
21Item {
22 readonly property real maximumContentWidth: units.gu(50)
22 readonly property real maximumContentWidth: units.gu(50)
23 readonly property bool desktopLook: width > units.gu(90) && width > height
23 readonly property bool desktopLook: width > units.gu(90) && width > height
24+ readonly property bool contentAnimationRunning: contentAnimation.running
24
25
25 readonly property real buttonMargin: units.gu(3)
26 readonly property real buttonMargin: units.gu(3)
26 readonly property real buttonWidth: (width - buttonMargin * 2) / 2 -
27 readonly property real buttonWidth: (width - buttonMargin * 2) / 2 -
qml/Wizard/Pages/50-timezone.qml+18−14
@@ -77,18 +77,21 @@ LocalComponents.Page {
77 id: timeDatePanel
77 id: timeDatePanel
78 }
78 }
79
79
80− Component.onCompleted: {
80+ onContentAnimationRunningChanged: {
81+ if (!contentAnimationRunning) {
81− if (tzList.count == 1) { // preselect the first (and only) TZ
82+ if (tzList.count == 1) { // preselect the first (and only) TZ
82− var tz = tzList.itemAt(0,0);
83+ var tz = tzList.itemAt(0,0);
83− if (!!tz) {
84+ if (!!tz) {
84− tz.clicked();
85+ tz.clicked();
86+ }
85 }
87 }
86− }
87
88
89+ resetViews();
88− tzFilterModel.filter = Qt.binding(function() { return searchField.text; });
90+ tzFilterModel.filter = Qt.binding(function() { return searchField.text; });
89− tzFilterModel.invalidate();
91+ tzFilterModel.invalidate();
90− theme.palette.normal.backgroundText = "#cdcdcd";
92+ theme.palette.normal.backgroundText = "#cdcdcd";
91− searchField.forceActiveFocus();
93+ searchField.forceActiveFocus();
94+ }
92 }
95 }
93
96
94 Component {
97 Component {
@@ -209,7 +212,7 @@ LocalComponents.Page {
209 Layout.fillWidth: desktopLook
212 Layout.fillWidth: desktopLook
210 Layout.fillHeight: true
213 Layout.fillHeight: true
211 id: mapContainer
214 id: mapContainer
212− visible: desktopLook
215+ visible: desktopLook && !contentAnimationRunning
213 enabled: visible
216 enabled: visible
214
217
215 Item {
218 Item {
@@ -225,21 +228,22 @@ LocalComponents.Page {
225 source: "data/timezonemap/map.png"
228 source: "data/timezonemap/map.png"
226 sourceSize: Qt.size(map.width, map.height)
229 sourceSize: Qt.size(map.width, map.height)
227 fillMode: Image.PreserveAspectFit
230 fillMode: Image.PreserveAspectFit
228− smooth: true
231+ smooth: false
229 visible: false
232 visible: false
233+ asynchronous: true
230 }
234 }
231
235
232 Image {
236 Image {
233 id: highlightImage
237 id: highlightImage
234 sourceSize: Qt.size(map.width, map.height)
238 sourceSize: Qt.size(map.width, map.height)
235 fillMode: Image.PreserveAspectFit
239 fillMode: Image.PreserveAspectFit
236− smooth: true
240+ smooth: false
237 visible: false
241 visible: false
242+ asynchronous: true
238 }
243 }
239
244
240 Blend {
245 Blend {
241 anchors.fill: map
246 anchors.fill: map
242− cached: true
243 source: backgroundImage
247 source: backgroundImage
244 foregroundSource: highlightImage
248 foregroundSource: highlightImage
245 }
249 }