parent
82e34d64a6
commit
44b275f23d
|
@ -5,6 +5,9 @@ import StatusQ.Core.Theme 0.1
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: statusRoundImage
|
id: statusRoundImage
|
||||||
|
|
||||||
|
property bool showLoadingIndicator: false
|
||||||
|
|
||||||
property alias image: image
|
property alias image: image
|
||||||
|
|
||||||
implicitWidth: 40
|
implicitWidth: 40
|
||||||
|
@ -28,4 +31,15 @@ Rectangle {
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
cache: true
|
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
|
height: 28
|
||||||
StatusRoundedImage {
|
StatusRoundedImage {
|
||||||
id: statusRoundImage
|
id: statusRoundImage
|
||||||
|
showLoadingIndicator: true
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
image.source: icon.source
|
image.source: icon.source
|
||||||
}
|
}
|
||||||
Loader {
|
Loader {
|
||||||
sourceComponent: {
|
sourceComponent:letterIdenticon
|
||||||
switch (statusRoundImage.image.status) {
|
|
||||||
case Image.Loading:
|
|
||||||
return statusLoadingIndicator
|
|
||||||
break;
|
|
||||||
case Image.Error:
|
|
||||||
return letterIdenticon
|
|
||||||
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 {
|
Component {
|
||||||
|
|
Loading…
Reference in New Issue