fix(communities/portal): scale banner to fit community card

This commit is contained in:
Patryk Osmaczko 2022-10-18 10:51:47 +02:00 committed by osmaczko
parent a543f46de5
commit c805219463
1 changed files with 12 additions and 4 deletions

View File

@ -178,29 +178,37 @@ Rectangle {
// Community banner:
Item {
id: banner
anchors.top: parent.top
width: d.cardWidth
width: parent.width
height: d.bannerHeigth
Rectangle {
id: mask
anchors.fill: parent
radius: d.bannerRadius
color: root.loaded ? root.communityColor : d.loadingColor2
// hide when image is loaded to avoid glitches on the edge
visible: image.status !== Image.Ready
}
Image {
id: image
source: root.banner
anchors.fill: parent
anchors.centerIn: parent
fillMode: Image.PreserveAspectFit
source: root.banner
fillMode: Image.PreserveAspectCrop
smooth: true
visible: false
}
OpacityMask {
anchors.fill: image
source: image
maskSource: mask
}