mirror of https://github.com/status-im/StatusQ.git
parent
82e34d64a6
commit
44b275f23d
|
@ -5,6 +5,9 @@ import StatusQ.Core.Theme 0.1
|
|||
|
||||
Rectangle {
|
||||
id: statusRoundImage
|
||||
|
||||
property bool showLoadingIndicator: false
|
||||
|
||||
property alias image: image
|
||||
|
||||
implicitWidth: 40
|
||||
|
@ -28,4 +31,15 @@ Rectangle {
|
|||
fillMode: Image.PreserveAspectFit
|
||||
cache: true
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: itemSelector
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
active: showLoadingIndicator && image.status === Image.Loading
|
||||
sourceComponent: StatusLoadingIndicator {
|
||||
color: Theme.palette.directColor6
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,24 +45,17 @@ TabButton {
|
|||
height: 28
|
||||
StatusRoundedImage {
|
||||
id: statusRoundImage
|
||||
showLoadingIndicator: true
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
image.source: icon.source
|
||||
}
|
||||
Loader {
|
||||
sourceComponent: {
|
||||
switch (statusRoundImage.image.status) {
|
||||
case Image.Loading:
|
||||
return statusLoadingIndicator
|
||||
break;
|
||||
case Image.Error:
|
||||
return letterIdenticon
|
||||
break;
|
||||
}
|
||||
}
|
||||
sourceComponent:letterIdenticon
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
active: statusRoundImage.image.status === Image.Loading || statusRoundImage.image.status === Image.Error
|
||||
active: statusRoundImage.image.status === Image.Error
|
||||
}
|
||||
|
||||
Component {
|
||||
|
|
Loading…
Reference in New Issue