on xenial help sign in
Audio Cards: Make some of the image loading async
445c1cdAlbert Astals Cid
plugins/Dash/AudioProgressBar.qml+1
@@ -31,6 +31,7 @@ Item {
31 anchors { left: parent.left; right: parent.right }
31 anchors { left: parent.left; right: parent.right }
32 height: units.dp(6)
32 height: units.dp(6)
33 source: "graphics/music_progress_bg.png"
33 source: "graphics/music_progress_bg.png"
34+ asynchronous: true
34 sourceSize.width: width
35 sourceSize.width: width
35 sourceSize.height: height
36 sourceSize.height: height
36 }
37 }
plugins/Dash/CardCreator.js+9−2
@@ -150,11 +150,18 @@ var kAudioButtonCode = 'AbstractButton { \n\
150 visible: parent.pressed; \n\
150 visible: parent.pressed; \n\
151 radius: "medium"; \n\
151 radius: "medium"; \n\
152 } \n\
152 } \n\
153− Icon { \n\
153+ Image { \n\
154+ id: icon; \n\
154 anchors.fill: parent; \n\
155 anchors.fill: parent; \n\
155 anchors.margins: parent.height > units.gu(5) ? units.gu(2) : 0; \n\
156 anchors.margins: parent.height > units.gu(5) ? units.gu(2) : 0; \n\
156 opacity: 0.9; \n\
157 opacity: 0.9; \n\
158+ fillMode: Image.PreserveAspectFit; \n\
159+ sourceSize { \n\
160+ width: icon.width; \n\
161+ height: icon.height; \n\
162+ } \n\
157− name: DashAudioPlayer.playing && AudioUrlComparer.compare(parent.source, DashAudioPlayer.currentSource) ? "media-playback-pause" : "media-playback-start"; \n\
163+ source: "image://theme/" + (DashAudioPlayer.playing && AudioUrlComparer.compare(parent.source, DashAudioPlayer.currentSource) ? "media-playback-pause" : "media-playback-start"); \n\
164+ asynchronous: true; \n\
158 } \n\
165 } \n\
159 onClicked: { \n\
166 onClicked: { \n\
160 if (AudioUrlComparer.compare(source, DashAudioPlayer.currentSource)) { \n\
167 if (AudioUrlComparer.compare(source, DashAudioPlayer.currentSource)) { \n\