on xenial help sign in
Audio Cards: Make some of the image loading async

It improves a bit the smoothness of scrolling the list Fixes: #1533432 Approved by: Andrea Cimitan

commitd0b7bcc5cfc9ec91a7122f379f1ff3276ade6cba authorAlbert Astals Cid <albert.astals@canonical.com> dateThu 10 Mar 2016, 22:38 (11 years ago) parent755227920d616f
5 files changed+11−6
debian/control+4−4 plugins/Dash/AudioProgressBar.qml+1 plugins/Dash/CardCreator.js+3−1 tests/plugins/Dash/cardcreator/9.res+2−1 tests/plugins/Dash/cardcreator/9.res.cardcreator+1
debian/control+4−4
@@ -55,7 +55,7 @@ Build-Depends: cmake,
5555 qtdeclarative5-qtmultimedia-plugin (>= 5.4.1-1ubuntu19~overlay2),
5656 qtdeclarative5-ubuntu-content1,
5757 qtdeclarative5-ubuntu-settings-components (>= 0.7),
58− qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1796) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1796),
58+ qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1845) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1845),
5959 qtdeclarative5-ubuntu-web-plugin,
6060 ttf-ubuntu-font-family,
6161Standards-Version: 3.9.4
@@ -70,7 +70,7 @@ X-Ubuntu-Use-Langpack: yes
7070Package: indicators-client
7171Architecture: amd64 armhf i386
7272Depends: qmenumodel-qml (>= 0.2.9),
73− qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1796) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1796),
73+ qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1845) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1845),
7474 unity8 (= ${binary:Version}),
7575 ${misc:Depends},
7676 ${shlibs:Depends},
@@ -128,7 +128,7 @@ Architecture: all
128128Depends: qml-module-qtquick-layouts,
129129 qtdeclarative5-ubuntu-settings-components (>= 0.7),
130130 qtdeclarative5-ubuntu-thumbnailer0.1 | ubuntu-thumbnailer-impl,
131− qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1796) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1796),
131+ qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1845) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1845),
132132 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
133133 ubuntu-thumbnailer-impl-0,
134134 unity-application-impl-13,
@@ -158,7 +158,7 @@ Depends: autopilot-qt5 (>= 1.4),
158158 python3-fixtures,
159159 python3-gi,
160160 qttestability-autopilot (>= 1.4),
161− ubuntu-ui-toolkit-autopilot (>= 1.3.1796),
161+ ubuntu-ui-toolkit-autopilot (>= 1.3.1845),
162162 unity-scope-click,
163163 unity8 (= ${source:Version}),
164164 unity8-fake-env (= ${source:Version}),
plugins/Dash/AudioProgressBar.qml+1
@@ -31,6 +31,7 @@ Item {
3131 anchors { left: parent.left; right: parent.right }
3232 height: units.dp(6)
3333 source: "graphics/music_progress_bg.png"
34+ asynchronous: true
3435 sourceSize.width: width
3536 sourceSize.height: height
3637 }
plugins/Dash/CardCreator.js+3−1
@@ -146,6 +146,7 @@ var kArtShapeHolderCode = 'Item { \n\
146146// %1 is anchors.fill
147147// %2 is width
148148// %3 is height
149+// %4 is whether the icon should be asynchronous or not
149150var kAudioButtonCode = 'AbstractButton { \n\
150151 id: audioButton; \n\
151152 anchors.fill: %1; \n\
@@ -171,6 +172,7 @@ var kAudioButtonCode = 'AbstractButton { \n\
171172 opacity: 0.9; \n\
172173 name: DashAudioPlayer.playing && AudioUrlComparer.compare(parent.source, DashAudioPlayer.currentSource) ? "media-playback-pause" : "media-playback-start"; \n\
173174 color: "white"; \n\
175+ asynchronous: %4; \n\
174176 } \n\
175177 onClicked: { \n\
176178 if (AudioUrlComparer.compare(source, DashAudioPlayer.currentSource)) { \n\
@@ -818,7 +820,7 @@ function cardString(template, components, isCardTool) {
818820 audioButtonHeight = isCardTool ? 'headerHeight + 2 * units.gu(1)'
819821 : 'root.fixedHeaderHeight + 2 * units.gu(1)';
820822 }
821− code += kAudioButtonCode.arg(audioButtonAnchorsFill).arg(audioButtonWidth).arg(audioButtonHeight);
823+ code += kAudioButtonCode.arg(audioButtonAnchorsFill).arg(audioButtonWidth).arg(audioButtonHeight).arg(asynchronous);
822824 }
823825
824826 if (hasSummary) {
tests/plugins/Dash/cardcreator/9.res+2−1
@@ -91,7 +91,8 @@ CardAudioProgress {
9191 opacity: 0.9;
9292 name: DashAudioPlayer.playing && AudioUrlComparer.compare(parent.source, DashAudioPlayer.currentSource) ? "media-playback-pause" : "media-playback-start";
9393 color: "white";
94− }
94+ asynchronous: true;
95+ }
9596 onClicked: {
9697 if (AudioUrlComparer.compare(source, DashAudioPlayer.currentSource)) {
9798 if (DashAudioPlayer.playing) {
tests/plugins/Dash/cardcreator/9.res.cardcreator+1
@@ -90,6 +90,7 @@ CardAudioProgress {
9090 opacity: 0.9;
9191 name: DashAudioPlayer.playing && AudioUrlComparer.compare(parent.source, DashAudioPlayer.currentSource) ? "media-playback-pause" : "media-playback-start";
9292 color: "white";
93+ asynchronous: false;
9394 }
9495 onClicked: {
9596 if (AudioUrlComparer.compare(source, DashAudioPlayer.currentSource)) {