mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 13:05:51 +03:00
Fix ActivityItemContent QML paintedWidth errors
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
This commit is contained in:
parent
dee460735e
commit
e3d897cb7f
1 changed files with 7 additions and 2 deletions
|
@ -81,16 +81,21 @@ RowLayout {
|
||||||
width: model.thumbnail !== undefined ? parent.width * 0.4 : thumbnailItem.imageWidth
|
width: model.thumbnail !== undefined ? parent.width * 0.4 : thumbnailItem.imageWidth
|
||||||
height: model.thumbnail !== undefined ? width : width * 0.9
|
height: model.thumbnail !== undefined ? width : width * 0.9
|
||||||
|
|
||||||
|
// Prevent bad access into unloaded item properties
|
||||||
|
readonly property int thumbnailPaintedWidth: thumbnailImageLoader.item ? thumbnailImageLoader.item.paintedWidth : 0
|
||||||
|
readonly property int thumbnailPaintedHeight: thumbnailImageLoader.item ? thumbnailImageLoader.item.paintedHeight : 0
|
||||||
|
|
||||||
readonly property int negativeLeftMargin: -((width / 2) +
|
readonly property int negativeLeftMargin: -((width / 2) +
|
||||||
((width - paintedWidth) / 2) +
|
((width - paintedWidth) / 2) +
|
||||||
((thumbnailImageLoader.width - thumbnailItem.imageWidth) / 2) +
|
((thumbnailImageLoader.width - thumbnailItem.imageWidth) / 2) +
|
||||||
((thumbnailImageLoader.width - thumbnailImageLoader.item.paintedWidth) / 2) +
|
((thumbnailImageLoader.width - thumbnailPaintedWidth) / 2) +
|
||||||
(thumbnailItem.thumbnailRadius / 4))
|
(thumbnailItem.thumbnailRadius / 4))
|
||||||
readonly property int negativeTopMargin: -((height / 2) +
|
readonly property int negativeTopMargin: -((height / 2) +
|
||||||
((height - paintedHeight) / 2) +
|
((height - paintedHeight) / 2) +
|
||||||
((thumbnailImageLoader.height - thumbnailItem.imageHeight) / 4) +
|
((thumbnailImageLoader.height - thumbnailItem.imageHeight) / 4) +
|
||||||
((thumbnailImageLoader.height - thumbnailImageLoader.item.paintedHeight) / 4) +
|
((thumbnailImageLoader.height - thumbnailPaintedHeight) / 4) +
|
||||||
(thumbnailItem.thumbnailRadius / 4))
|
(thumbnailItem.thumbnailRadius / 4))
|
||||||
|
|
||||||
anchors.verticalCenter: if(model.thumbnail === undefined) parent.verticalCenter
|
anchors.verticalCenter: if(model.thumbnail === undefined) parent.verticalCenter
|
||||||
anchors.left: model.thumbnail === undefined ? parent.left : thumbnailImageLoader.right
|
anchors.left: model.thumbnail === undefined ? parent.left : thumbnailImageLoader.right
|
||||||
anchors.leftMargin: if(model.thumbnail !== undefined) negativeLeftMargin
|
anchors.leftMargin: if(model.thumbnail !== undefined) negativeLeftMargin
|
||||||
|
|
Loading…
Reference in a new issue