refactor: make use of `StatusRoundImage`'s built-in loading indicator

Closes #89
This commit is contained in:
Pascal Precht 2021-05-28 14:00:24 +02:00 committed by Pascal Precht
parent c0ad32a192
commit b1cbcd256d
3 changed files with 6 additions and 42 deletions

View File

@ -81,26 +81,12 @@ Rectangle {
width: parent.width
height: parent.height
image.source: statusChatListItem.image.source
showLoadingIndicator: true
}
Loader {
sourceComponent: {
switch (statusRoundedImage.image.status) {
case Image.Loading:
return statusLoadingIndicator
break;
case Image.Error:
return statusLetterIdenticonCmp
break;
}
}
}
Component {
id: statusLoadingIndicator
StatusLoadingIndicator {
color: Theme.palette.directColor6
}
sourceComponent: statusLetterIdenticonCmp
active: statusRoundedImage.image.status === Image.Error
}
}
}

View File

@ -68,28 +68,13 @@ Rectangle {
width: parent.width
height: parent.height
image.source: statusChatInfoButton.image.source
showLoadingIndicator: true
}
Loader {
sourceComponent: {
switch (statusRoundImage.image.status) {
case Image.Loading:
return statusLoadingIndicator
break;
case Image.Error:
return statusLetterIdenticonComponent
break;
}
}
sourceComponent: statusLetterIdenticonComponent
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
active: statusRoundImage.image.status === Image.Loading || statusRoundImage.image.status === Image.Error
}
Component {
id: statusLoadingIndicator
StatusLoadingIndicator {
color: Theme.palette.directColor6
}
active: statusRoundImage.image.status === Image.Error
}
}
}

View File

@ -57,13 +57,6 @@ TabButton {
anchors.horizontalCenter: parent.horizontalCenter
active: statusRoundImage.image.status === Image.Error
}
Component {
id: statusLoadingIndicator
StatusLoadingIndicator {
color: Theme.palette.directColor6
}
}
}
}