Show spinner for loading media event thumbnails

This commit is contained in:
miruka 2020-07-16 17:15:33 -04:00
parent 606fe3d022
commit 0515a94429
2 changed files with 11 additions and 6 deletions

View File

@ -15,7 +15,6 @@ Image {
property alias radius: roundMask.radius
property alias showProgressBar: progressBarLoader.active
property bool inderterminateProgressBar: false
readonly property int circleRadius:
Math.ceil(Math.max(image.width, image.height))
@ -104,15 +103,20 @@ Image {
HLoader {
id: progressBarLoader
readonly property alias progress: image.progress
readonly property Component determinate: HCircleProgressBar {
progress: image.progress
}
anchors.centerIn: parent
width: Math.min(parent.width, parent.height) * 0.5
height: width
active: image.status === Image.Loading
sourceComponent: HBusyIndicator {}
sourceComponent: HCircleProgressBar {
id: progressBar
progress: image.progress
}
onProgressChanged:
if (progress > 0 && progress < 1) sourceComponent = determinate
}
HIcon {

View File

@ -56,8 +56,9 @@ HImage {
}
inderterminateProgressBar: isMxc
source: sourceOverride || (show ? cachedPath : "")
showProgressBar:
(isMxc && status === Image.Null) || status === Image.Loading
onWidthChanged: Qt.callLater(update)
onHeightChanged: Qt.callLater(update)