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 Michał Cieślak
parent 60d3bdaff4
commit 93a0b2ae21
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
}
}
}
}