refactor: make use of `StatusRoundImage`'s built-in loading indicator
Closes #89
This commit is contained in:
parent
60d3bdaff4
commit
93a0b2ae21
|
@ -81,26 +81,12 @@ Rectangle {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
image.source: statusChatListItem.image.source
|
image.source: statusChatListItem.image.source
|
||||||
|
showLoadingIndicator: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
sourceComponent: {
|
sourceComponent: statusLetterIdenticonCmp
|
||||||
switch (statusRoundedImage.image.status) {
|
active: statusRoundedImage.image.status === Image.Error
|
||||||
case Image.Loading:
|
|
||||||
return statusLoadingIndicator
|
|
||||||
break;
|
|
||||||
case Image.Error:
|
|
||||||
return statusLetterIdenticonCmp
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: statusLoadingIndicator
|
|
||||||
StatusLoadingIndicator {
|
|
||||||
color: Theme.palette.directColor6
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,28 +68,13 @@ Rectangle {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
image.source: statusChatInfoButton.image.source
|
image.source: statusChatInfoButton.image.source
|
||||||
|
showLoadingIndicator: true
|
||||||
}
|
}
|
||||||
Loader {
|
Loader {
|
||||||
sourceComponent: {
|
sourceComponent: statusLetterIdenticonComponent
|
||||||
switch (statusRoundImage.image.status) {
|
|
||||||
case Image.Loading:
|
|
||||||
return statusLoadingIndicator
|
|
||||||
break;
|
|
||||||
case Image.Error:
|
|
||||||
return statusLetterIdenticonComponent
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
active: statusRoundImage.image.status === Image.Loading || statusRoundImage.image.status === Image.Error
|
active: statusRoundImage.image.status === Image.Error
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: statusLoadingIndicator
|
|
||||||
StatusLoadingIndicator {
|
|
||||||
color: Theme.palette.directColor6
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,13 +57,6 @@ TabButton {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
active: statusRoundImage.image.status === Image.Error
|
active: statusRoundImage.image.status === Image.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
|
||||||
id: statusLoadingIndicator
|
|
||||||
StatusLoadingIndicator {
|
|
||||||
color: Theme.palette.directColor6
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue