mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 04:58:49 +03:00
fixed most of the binding loops
This commit is contained in:
parent
5db7ec7f03
commit
0e548b7d39
7 changed files with 25 additions and 6 deletions
|
@ -102,7 +102,7 @@ Item {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
top: parent.top
|
top: parent.top
|
||||||
}
|
}
|
||||||
property bool narrowLayout: (r.width < 500) && Settings.bubbles
|
property bool narrowLayout: Settings.bubbles //&& (timelineView.width < 500) // timelineView causes fewew binding loops than r. But maybe it shouldn't depend on width anyway
|
||||||
rowSpacing: 0
|
rowSpacing: 0
|
||||||
columnSpacing: 2
|
columnSpacing: 2
|
||||||
columns: narrowLayout? 1 : 2
|
columns: narrowLayout? 1 : 2
|
||||||
|
@ -142,6 +142,7 @@ Item {
|
||||||
callType: r.relatedEventCacheBuster, fromModel(Room.CallType) ?? ""
|
callType: r.relatedEventCacheBuster, fromModel(Room.CallType) ?? ""
|
||||||
encryptionError: r.relatedEventCacheBuster, fromModel(Room.EncryptionError) ?? ""
|
encryptionError: r.relatedEventCacheBuster, fromModel(Room.EncryptionError) ?? ""
|
||||||
relatedEventCacheBuster: r.relatedEventCacheBuster, fromModel(Room.RelatedEventCacheBuster) ?? 0
|
relatedEventCacheBuster: r.relatedEventCacheBuster, fromModel(Room.RelatedEventCacheBuster) ?? 0
|
||||||
|
maxWidth: row.maxWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
// actual message content
|
// actual message content
|
||||||
|
@ -173,6 +174,7 @@ Item {
|
||||||
encryptionError: r.encryptionError
|
encryptionError: r.encryptionError
|
||||||
relatedEventCacheBuster: r.relatedEventCacheBuster
|
relatedEventCacheBuster: r.relatedEventCacheBuster
|
||||||
isReply: false
|
isReply: false
|
||||||
|
maxWidth: row.maxWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|
|
@ -11,9 +11,11 @@ Item {
|
||||||
required property string eventId
|
required property string eventId
|
||||||
required property string filename
|
required property string filename
|
||||||
required property string filesize
|
required property string filesize
|
||||||
|
property int maxWidth
|
||||||
|
|
||||||
height: row.height + 24
|
height: row.height + 24
|
||||||
width: parent.width
|
width: maxWidth
|
||||||
|
implicitWidth: maxWidth
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: row
|
id: row
|
||||||
|
|
|
@ -17,13 +17,16 @@ Item {
|
||||||
required property string filename
|
required property string filename
|
||||||
required property bool isReply
|
required property bool isReply
|
||||||
required property string eventId
|
required property string eventId
|
||||||
property double tempWidth: Math.min(parent.width, originalWidth < 1 ? 200 : originalWidth)
|
property int maxWidth
|
||||||
|
property double tempWidth: Math.min(maxWidth, originalWidth < 1 ? 200 : originalWidth)
|
||||||
property double tempHeight: tempWidth * proportionalHeight
|
property double tempHeight: tempWidth * proportionalHeight
|
||||||
property double divisor: isReply ? 5 : 3
|
property double divisor: isReply ? 5 : 3
|
||||||
property bool tooHigh: tempHeight > timelineView.height / divisor
|
property bool tooHigh: tempHeight > timelineView.height / divisor
|
||||||
|
|
||||||
height: Math.round(tooHigh ? timelineView.height / divisor : tempHeight)
|
height: Math.round(tooHigh ? timelineView.height / divisor : tempHeight)
|
||||||
width: Math.round(tooHigh ? (timelineView.height / divisor) / proportionalHeight : tempWidth)
|
width: Math.round(tooHigh ? (timelineView.height / divisor) / proportionalHeight : tempWidth)
|
||||||
|
implicitHeight: height
|
||||||
|
implicitWidth: width
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: blurhash_
|
id: blurhash_
|
||||||
|
|
|
@ -13,7 +13,7 @@ Item {
|
||||||
|
|
||||||
required property bool isReply
|
required property bool isReply
|
||||||
property alias child: chooser.child
|
property alias child: chooser.child
|
||||||
implicitWidth: (chooser.child && chooser.child.implicitWidth) ? chooser.child.implicitWidth : width
|
implicitWidth: (chooser.child && chooser.child.implicitWidth) ? chooser.child.implicitWidth : 0
|
||||||
required property double proportionalHeight
|
required property double proportionalHeight
|
||||||
required property int type
|
required property int type
|
||||||
required property string typeString
|
required property string typeString
|
||||||
|
@ -35,6 +35,7 @@ Item {
|
||||||
required property string callType
|
required property string callType
|
||||||
required property int encryptionError
|
required property int encryptionError
|
||||||
required property int relatedEventCacheBuster
|
required property int relatedEventCacheBuster
|
||||||
|
property int maxWidth
|
||||||
|
|
||||||
Layout.preferredHeight: chooser.child ? chooser.child.height : Nheko.paddingLarge
|
Layout.preferredHeight: chooser.child ? chooser.child.height : Nheko.paddingLarge
|
||||||
|
|
||||||
|
@ -110,6 +111,7 @@ Item {
|
||||||
filename: d.filename
|
filename: d.filename
|
||||||
isReply: d.isReply
|
isReply: d.isReply
|
||||||
eventId: d.eventId
|
eventId: d.eventId
|
||||||
|
maxWidth: d.maxWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -127,6 +129,7 @@ Item {
|
||||||
filename: d.filename
|
filename: d.filename
|
||||||
isReply: d.isReply
|
isReply: d.isReply
|
||||||
eventId: d.eventId
|
eventId: d.eventId
|
||||||
|
maxWidth: d.maxWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -138,6 +141,7 @@ Item {
|
||||||
eventId: d.eventId
|
eventId: d.eventId
|
||||||
filename: d.filename
|
filename: d.filename
|
||||||
filesize: d.filesize
|
filesize: d.filesize
|
||||||
|
maxWidth: d.maxWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -154,6 +158,7 @@ Item {
|
||||||
url: d.url
|
url: d.url
|
||||||
body: d.body
|
body: d.body
|
||||||
filesize: d.filesize
|
filesize: d.filesize
|
||||||
|
maxWidth: d.maxWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -170,6 +175,7 @@ Item {
|
||||||
url: d.url
|
url: d.url
|
||||||
body: d.body
|
body: d.body
|
||||||
filesize: d.filesize
|
filesize: d.filesize
|
||||||
|
maxWidth: d.maxWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -372,7 +378,7 @@ Item {
|
||||||
isOnlyEmoji: false
|
isOnlyEmoji: false
|
||||||
isReply: d.isReply
|
isReply: d.isReply
|
||||||
isStateEvent: d.isStateEvent
|
isStateEvent: d.isStateEvent
|
||||||
formatted: qsTr("% is negotiating the call...").arg(d.userName)
|
formatted: qsTr("%1 is negotiating the call...").arg(d.userName)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,13 +22,16 @@ Item {
|
||||||
required property string url
|
required property string url
|
||||||
required property string body
|
required property string body
|
||||||
required property string filesize
|
required property string filesize
|
||||||
property double tempWidth: Math.min(parent.width, originalWidth < 1 ? 400 : originalWidth)
|
property int maxWidth
|
||||||
|
property double tempWidth: Math.min(maxWidth, originalWidth < 1 ? 400 : originalWidth)
|
||||||
property double tempHeight: tempWidth * proportionalHeight
|
property double tempHeight: tempWidth * proportionalHeight
|
||||||
property double divisor: isReply ? 4 : 2
|
property double divisor: isReply ? 4 : 2
|
||||||
property bool tooHigh: tempHeight > timelineRoot.height / divisor
|
property bool tooHigh: tempHeight > timelineRoot.height / divisor
|
||||||
|
|
||||||
height: (type == MtxEvent.VideoMessage ? tooHigh ? timelineRoot.height / divisor : tempHeight : 80) + fileInfoLabel.height
|
height: (type == MtxEvent.VideoMessage ? tooHigh ? timelineRoot.height / divisor : tempHeight : 80) + fileInfoLabel.height
|
||||||
width: type == MtxEvent.VideoMessage ? tooHigh ? (timelineRoot.height / divisor) / proportionalHeight : tempWidth : 250
|
width: type == MtxEvent.VideoMessage ? tooHigh ? (timelineRoot.height / divisor) / proportionalHeight : tempWidth : 250
|
||||||
|
implicitHeight: height
|
||||||
|
implicitWidth: width
|
||||||
|
|
||||||
MxcMedia {
|
MxcMedia {
|
||||||
id: mxcmedia
|
id: mxcmedia
|
||||||
|
|
|
@ -13,6 +13,7 @@ Rectangle{
|
||||||
required property real delegateWidth
|
required property real delegateWidth
|
||||||
height: redactedLayout.implicitHeight + Nheko.paddingSmall
|
height: redactedLayout.implicitHeight + Nheko.paddingSmall
|
||||||
width: redactedLayout.implicitWidth + 2 * Nheko.paddingMedium
|
width: redactedLayout.implicitWidth + 2 * Nheko.paddingMedium
|
||||||
|
implicitWidth: width
|
||||||
radius: fontMetrics.lineSpacing / 2 + 2 * Nheko.paddingSmall
|
radius: fontMetrics.lineSpacing / 2 + 2 * Nheko.paddingSmall
|
||||||
color: Nheko.colors.alternateBase
|
color: Nheko.colors.alternateBase
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ Item {
|
||||||
property string callType
|
property string callType
|
||||||
property int encryptionError
|
property int encryptionError
|
||||||
property int relatedEventCacheBuster
|
property int relatedEventCacheBuster
|
||||||
|
property int maxWidth
|
||||||
|
|
||||||
Layout.preferredHeight: replyContainer.height
|
Layout.preferredHeight: replyContainer.height
|
||||||
height: replyContainer.height
|
height: replyContainer.height
|
||||||
|
@ -124,6 +125,7 @@ Item {
|
||||||
enabled: false
|
enabled: false
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
isReply: true
|
isReply: true
|
||||||
|
maxWidth: r.maxWidth-4
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue