Fix layout - no more binding loops (hopefully)

This commit is contained in:
Malte E 2022-02-11 22:02:30 +01:00
parent 0e548b7d39
commit d0ac110cb7
10 changed files with 35 additions and 60 deletions

View file

@ -17,16 +17,11 @@ Item {
required property string filename
required property bool isReply
required property string eventId
property int maxWidth
property double tempWidth: Math.min(maxWidth, originalWidth < 1 ? 200 : originalWidth)
property double tempHeight: tempWidth * proportionalHeight
property double divisor: isReply ? 5 : 3
property bool tooHigh: tempHeight > timelineView.height / divisor
height: Math.round(tooHigh ? timelineView.height / divisor : tempHeight)
width: Math.round(tooHigh ? (timelineView.height / divisor) / proportionalHeight : tempWidth)
implicitHeight: height
implicitWidth: width
implicitWidth: Math.round(originalWidth*Math.min((timelineView.height/divisor)/(originalWidth*proportionalHeight), 1))
width: parent.width
height: width*proportionalHeight
Image {
id: blurhash_