on xenial help sign in
optimize the resource heavy TZ page some more
commitf3fd679cf8dc634d73a24742ebbfa4e714756e91 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateMon 22 Feb 2016, 13:39 (11 years ago) parent800b41e
2 files changed+19−14
qml/Wizard/Page.qml+1 qml/Wizard/Pages/50-timezone.qml+18−14
qml/Wizard/Page.qml+1
@@ -21,6 +21,7 @@ import Wizard 0.1
2121Item {
2222 readonly property real maximumContentWidth: units.gu(50)
2323 readonly property bool desktopLook: width > units.gu(90) && width > height
24+ readonly property bool contentAnimationRunning: contentAnimation.running
2425
2526 readonly property real buttonMargin: units.gu(3)
2627 readonly property real buttonWidth: (width - buttonMargin * 2) / 2 -
qml/Wizard/Pages/50-timezone.qml+18−14
@@ -77,18 +77,21 @@ LocalComponents.Page {
7777 id: timeDatePanel
7878 }
7979
80− Component.onCompleted: {
81− if (tzList.count == 1) { // preselect the first (and only) TZ
82− var tz = tzList.itemAt(0,0);
83− if (!!tz) {
84− tz.clicked();
80+ onContentAnimationRunningChanged: {
81+ if (!contentAnimationRunning) {
82+ if (tzList.count == 1) { // preselect the first (and only) TZ
83+ var tz = tzList.itemAt(0,0);
84+ if (!!tz) {
85+ tz.clicked();
86+ }
8587 }
86− }
8788
88− tzFilterModel.filter = Qt.binding(function() { return searchField.text; });
89− tzFilterModel.invalidate();
90− theme.palette.normal.backgroundText = "#cdcdcd";
91− searchField.forceActiveFocus();
89+ resetViews();
90+ tzFilterModel.filter = Qt.binding(function() { return searchField.text; });
91+ tzFilterModel.invalidate();
92+ theme.palette.normal.backgroundText = "#cdcdcd";
93+ searchField.forceActiveFocus();
94+ }
9295 }
9396
9497 Component {
@@ -209,7 +212,7 @@ LocalComponents.Page {
209212 Layout.fillWidth: desktopLook
210213 Layout.fillHeight: true
211214 id: mapContainer
212− visible: desktopLook
215+ visible: desktopLook && !contentAnimationRunning
213216 enabled: visible
214217
215218 Item {
@@ -225,21 +228,22 @@ LocalComponents.Page {
225228 source: "data/timezonemap/map.png"
226229 sourceSize: Qt.size(map.width, map.height)
227230 fillMode: Image.PreserveAspectFit
228− smooth: true
231+ smooth: false
229232 visible: false
233+ asynchronous: true
230234 }
231235
232236 Image {
233237 id: highlightImage
234238 sourceSize: Qt.size(map.width, map.height)
235239 fillMode: Image.PreserveAspectFit
236− smooth: true
240+ smooth: false
237241 visible: false
242+ asynchronous: true
238243 }
239244
240245 Blend {
241246 anchors.fill: map
242− cached: true
243247 source: backgroundImage
244248 foregroundSource: highlightImage
245249 }