on xenial help sign in
drop percentage calculation and use progress instead
853615aMichael Zanetti
Dash/Music/MusicPreview.qml+2−2
@@ -57,7 +57,7 @@ GenericPreview {
57 Audio {
57 Audio {
58 id: audioPlayer
58 id: audioPlayer
59 objectName: "audioPlayer"
59 objectName: "audioPlayer"
60− property real percent: audioPlayer.position * 100 / audioPlayer.duration
60+ property real progress: audioPlayer.position / audioPlayer.duration
61
61
62 property Item playingItem
62 property Item playingItem
63
63
@@ -163,7 +163,7 @@ GenericPreview {
163 anchors.verticalCenter: progressBarImage.verticalCenter
163 anchors.verticalCenter: progressBarImage.verticalCenter
164 height: units.dp(2)
164 height: units.dp(2)
165 anchors.margins: units.dp(2)
165 anchors.margins: units.dp(2)
166− anchors.rightMargin: maxWidth - (maxWidth * audioPlayer.percent / 100) + units.dp(2)
166+ anchors.rightMargin: maxWidth - (maxWidth * audioPlayer.progress) + units.dp(2)
167 visible: progressBarImage.visible
167 visible: progressBarImage.visible
168 property int maxWidth: progressBarImage.width - units.dp(4)
168 property int maxWidth: progressBarImage.width - units.dp(4)
169 }
169 }