mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-10 06:16:32 +00:00
d9d6d90dc9
- legacy Style and ThemePalette removed - moved and deduplicated font definitions into `Theme` (unrelated to a color palette) - `Style.current.foo` -> `Theme.foo` - `Style.current.fooColor` -> `Theme.palette.fooColor` - upgrade the imports to 5.15 - removed some mode dead components Fixes #16514
43 lines
1.2 KiB
QML
43 lines
1.2 KiB
QML
import QtQuick 2.15
|
|
|
|
import StatusQ.Components 0.1
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import utils 1.0
|
|
|
|
StatusRoundedMedia {
|
|
id: root
|
|
|
|
readonly property bool isEmpty: !mediaUrl.toString() && !fallbackImageUrl.toString()
|
|
property color backgroundColor: Theme.palette.baseColor5
|
|
property bool isCollectibleLoading: false
|
|
property bool isMetadataValid: false
|
|
|
|
radius: Theme.radius
|
|
color: isError || isEmpty ? Theme.palette.baseColor5 : backgroundColor
|
|
|
|
Loader {
|
|
id: loadingCompLoader
|
|
anchors.fill: parent
|
|
active: root.isCollectibleLoading || root.isLoading
|
|
sourceComponent: LoadingComponent {radius: root.radius}
|
|
}
|
|
|
|
Loader {
|
|
anchors.fill: parent
|
|
active: (root.isError || root.isEmpty) && !loadingCompLoader.active
|
|
sourceComponent: LoadingErrorComponent {
|
|
radius: root.radius
|
|
text: {
|
|
if (root.isError && root.componentMediaType === StatusRoundedMedia.MediaType.Unkown) {
|
|
return qsTr("Unsupported\nfile format")
|
|
}
|
|
if (!root.isMetadataValid) {
|
|
return qsTr("Info can't\nbe fetched")
|
|
}
|
|
return qsTr("Failed\nto load")
|
|
}
|
|
}
|
|
}
|
|
}
|