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

It improves a bit the smoothness of scrolling the list

commit445c1cd13870c1ee0597841b777f9da7702a8df9 authorAlbert Astals Cid <albert.astals@canonical.com> dateMon 18 Jan 2016, 23:56 (11 years ago) parente2e7e7d
2 files changed+10−2
plugins/Dash/AudioProgressBar.qml+1 plugins/Dash/CardCreator.js+9−2
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+9−2
@@ -150,11 +150,18 @@ var kAudioButtonCode = 'AbstractButton { \n\
150150 visible: parent.pressed; \n\
151151 radius: "medium"; \n\
152152 } \n\
153− Icon { \n\
153+ Image { \n\
154+ id: icon; \n\
154155 anchors.fill: parent; \n\
155156 anchors.margins: parent.height > units.gu(5) ? units.gu(2) : 0; \n\
156157 opacity: 0.9; \n\
157− name: DashAudioPlayer.playing && AudioUrlComparer.compare(parent.source, DashAudioPlayer.currentSource) ? "media-playback-pause" : "media-playback-start"; \n\
158+ fillMode: Image.PreserveAspectFit; \n\
159+ sourceSize { \n\
160+ width: icon.width; \n\
161+ height: icon.height; \n\
162+ } \n\
163+ source: "image://theme/" + (DashAudioPlayer.playing && AudioUrlComparer.compare(parent.source, DashAudioPlayer.currentSource) ? "media-playback-pause" : "media-playback-start"); \n\
164+ asynchronous: true; \n\
158165 } \n\
159166 onClicked: { \n\
160167 if (AudioUrlComparer.compare(source, DashAudioPlayer.currentSource)) { \n\