Improve AudioBubble && fix flathub issue.

square-messages
Black Hat 2018-08-17 19:46:46 +08:00
parent 6e79bf6495
commit 6752791f5e
3 changed files with 12 additions and 10 deletions

4
.gitmodules vendored
View File

@ -1,6 +1,6 @@
[submodule "include/SortFilterProxyModel"]
path = include/SortFilterProxyModel
url = https://gitlab.com/b0/SortFilterProxyModel
url = https://gitlab.com/b0/SortFilterProxyModel.git
[submodule "include/libqmatrixclient"]
path = include/libqmatrixclient
url = https://github.com/QMatrixClient/libqmatrixclient
url = https://github.com/QMatrixClient/libqmatrixclient.git

View File

@ -12,10 +12,7 @@ AvatarContainer {
id: messageRow
Audio {
id: audioPlayer
source: progressInfo.localPath
}
Audio { id: audioPlayer }
DownloadableContent {
id: downloadable
@ -29,7 +26,7 @@ AvatarContainer {
maximumWidth: messageListView.width
highlighted: !sentByMe
timeLabelVisible: false
authorLabelVisible: messageRow.avatarVisible
authorLabelVisible: false
displayText: content.info.duration / 1000 + '"'
@ -40,7 +37,7 @@ AvatarContainer {
onClicked: {
if (downloadable.downloaded)
audioPlayer.play()
play()
else
{
playOnFinished = true
@ -49,6 +46,11 @@ AvatarContainer {
}
}
}
onDownloadedChanged: downloaded && playOnFinished ? audioPlayer.play() : {}
onDownloadedChanged: downloaded && playOnFinished ? play() : {}
}
function play() {
audioPlayer.source = progressInfo.localPath
audioPlayer.play()
}
}

View File

@ -20,7 +20,7 @@ AvatarContainer {
maximumWidth: messageListView.width
highlighted: !sentByMe
timeLabelVisible: false
authorLabelVisible: messageRow.avatarVisible
authorLabelVisible: false
displayText: "<b>File: </b>" + content.body
}