mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 13:56:10 +00:00
5eabcd2725
Related to: #586. Adds a loading state to stickers, so that a loading indicator appears while the sticker is being downloaded from IPFS. In the case of a network failure or timetout, a reload button is shown instead. Once network is restored and the reload button is clicked, the image is reloaded from the network, going through the same lifecycle of showing the loading state first.
35 lines
864 B
QML
35 lines
864 B
QML
import QtQuick 2.13
|
|
import QtQuick.Controls 2.13
|
|
import QtQuick.Layouts 1.3
|
|
import QtGraphicalEffects 1.0
|
|
import "../../../../imports"
|
|
import "../../../../shared"
|
|
|
|
GridView {
|
|
id: root
|
|
visible: count > 0
|
|
anchors.fill: parent
|
|
cellWidth: 88
|
|
cellHeight: 88
|
|
model: stickerList
|
|
focus: true
|
|
clip: true
|
|
signal stickerClicked(string hash, int packId)
|
|
delegate: Item {
|
|
width: stickerGrid.cellWidth
|
|
height: stickerGrid.cellHeight
|
|
Column {
|
|
anchors.fill: parent
|
|
anchors.topMargin: 4
|
|
anchors.leftMargin: 4
|
|
ImageLoader {
|
|
width: 80
|
|
height: 80
|
|
source: "https://ipfs.infura.io/ipfs/" + url
|
|
onClicked: {
|
|
root.stickerClicked(hash, packId)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |