fix: add image loader to collectibles images

This commit is contained in:
emizzle 2020-10-06 15:16:36 +11:00 committed by Iuri Matias
parent 3c9de2c432
commit 8a7d6d3f7e
5 changed files with 14 additions and 25 deletions

View File

@ -72,16 +72,17 @@ Item {
width: 18 width: 18
height: 18 height: 18
anchors.right: parent.right anchors.right: parent.right
property bool hovered: false
MouseArea { MouseArea {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onExited: { onExited: {
qrCodeButton.color = Style.current.white parent.hovered = false
} }
onEntered: { onEntered: {
qrCodeButton.color = Style.current.grey parent.hovered = true
} }
onClicked: { onClicked: {
showQR = !showQR showQR = !showQR
@ -90,9 +91,10 @@ Item {
} }
ColorOverlay { ColorOverlay {
id: qrCodeOverlay
anchors.fill: qrCodeImage anchors.fill: qrCodeImage
source: qrCodeImage source: qrCodeImage
color: Style.current.textColor color: qrCodeImage.hovered ? Style.current.buttonForegroundColor : Style.current.textColor
} }
Separator { Separator {

View File

@ -80,31 +80,17 @@ ScrollView {
height: collectibleImage.height height: collectibleImage.height
clip: true clip: true
Image { RoundedImage {
id: collectibleImage id: collectibleImage
width: root.imageSize width: root.imageSize
height: root.imageSize height: root.imageSize
z: 1 border.width: 1
border.color: Style.current.border
radius: 16
source: modelData.image source: modelData.image
sourceSize.width: width
sourceSize.height: height
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
}
Rectangle {
radius: 16
z: 2
border.width: 1
border.color: Style.current.border
color: Style.current.transparent
anchors.fill: parent
}
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: { onClicked: {
collectiblesModal.openModal({ collectiblesModal.openModal({
name: modelData.name, name: modelData.name,

View File

@ -12,14 +12,13 @@ Item {
id: root id: root
width: parent.width width: parent.width
Image { RoundedImage {
id: collectibleImage id: collectibleImage
width: 248 width: 248
height: 248 height: 248
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
source: root.collectibleImage source: root.collectibleImage
sourceSize.width: width radius: 16
sourceSize.height: height
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
} }

View File

@ -4,7 +4,8 @@ import "../imports"
Rectangle { Rectangle {
id: root id: root
property url source property alias source: image.source
property alias fillMode: image.fillMode
signal clicked signal clicked
color: Style.current.backgroundHover color: Style.current.backgroundHover
state: "loading" state: "loading"

View File

@ -5,6 +5,7 @@ Rectangle {
id: root id: root
signal clicked signal clicked
property alias source: imgStickerPackThumb.source property alias source: imgStickerPackThumb.source
property alias fillMode: imgStickerPackThumb.fillMode
radius: width / 2 radius: width / 2