Show spinner for loading media event thumbnails
This commit is contained in:
parent
606fe3d022
commit
0515a94429
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user