refactor: make use of `StatusRoundImage`'s built-in loading indicator
Closes #89
This commit is contained in:
parent
c0ad32a192
commit
b1cbcd256d
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,13 +57,6 @@ TabButton {
|
|||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
active: statusRoundImage.image.status === Image.Error
|
||||
}
|
||||
|
||||
Component {
|
||||
id: statusLoadingIndicator
|
||||
StatusLoadingIndicator {
|
||||
color: Theme.palette.directColor6
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue