Fix messed up delegate positions on new message

This commit is contained in:
miruka 2019-07-20 02:21:12 -04:00
parent 0488a7dde8
commit 3e1e924147
2 changed files with 4 additions and 10 deletions

View File

@ -17,10 +17,6 @@ Row {
opacity: hideAvatar || collapseAvatar ? 0 : 1 opacity: hideAvatar || collapseAvatar ? 0 : 1
visible: width > 0 visible: width > 0
// Don't animate w/h of avatar itself! It might affect the sourceSize
Behavior on width { HNumberAnimation {} }
Behavior on height { HNumberAnimation {} }
HUserAvatar { HUserAvatar {
id: avatar id: avatar
userId: model.senderId userId: model.senderId

View File

@ -12,8 +12,8 @@ Column {
property var previousItem: eventList.model.get(model.index + 1) property var previousItem: eventList.model.get(model.index + 1)
property var nextItem: eventList.model.get(model.index - 1) property var nextItem: eventList.model.get(model.index - 1)
property int modelCount: eventList.model.count property int modelIndex: model.index
onModelCountChanged: { onModelIndexChanged: {
previousItem = eventList.model.get(model.index + 1) previousItem = eventList.model.get(model.index + 1)
nextItem = eventList.model.get(model.index - 1) nextItem = eventList.model.get(model.index - 1)
} }
@ -49,14 +49,12 @@ Column {
combine ? theme.spacing / 2 : combine ? theme.spacing / 2 :
theme.spacing * 2 theme.spacing * 2
Loader { Daybreak {
source: dayBreak ? "Daybreak.qml" : "" visible: dayBreak
width: eventDelegate.width width: eventDelegate.width
} }
EventContent { EventContent {
// anchors.left: parent.left
// anchors.right: onRight ? parent.right : undefined
x: onRight ? parent.width - width : 0 x: onRight ? parent.width - width : 0
Behavior on x { HNumberAnimation {} } Behavior on x { HNumberAnimation {} }
} }