Revert "Fix the one-line events combining"

This reverts commit 39f159f0a3.

Causes problems when message delegates are reordered, with the
transition animations randomly stopping in the middle and leaving
delegates at odd positions.
This commit is contained in:
miruka
2021-03-01 18:52:30 -04:00
parent 32200f256b
commit 81c460cbaf
4 changed files with 16 additions and 23 deletions

View File

@@ -27,7 +27,7 @@ HRowLayout {
}
readonly property string senderText:
asOneLine || onRight || combine ? "" : (
hideNameLine ? "" : (
`<${compact ? "span" : "div"} class='sender'>` +
utils.coloredNameHtml(model.sender_name, model.sender_id) +
(compact ? ": " : "") +
@@ -94,25 +94,12 @@ HRowLayout {
opacity: combine ? 0 : 1
Layout.alignment: Qt.AlignTop
Layout.preferredHeight: combine ? 1 : Layout.preferredWidth
Layout.preferredWidth:
compact ?
theme.chat.message.collapsedAvatarSize :
theme.chat.message.avatarSize
Layout.preferredHeight:
combine ?
1 :
compact || (
asOneLine &&
nextModel &&
eventList.canCombine(model, nextModel)
) ?
theme.chat.message.collapsedAvatarSize :
theme.chat.message.avatarSize
HUserAvatar {
id: avatar
clientUserId: chat.userId
@@ -122,6 +109,7 @@ HRowLayout {
width: parent.width
height: combine ? 1 : parent.Layout.preferredWidth
radius: theme.chat.message.avatarRadius
}
}

View File

@@ -25,12 +25,20 @@ HColumnLayout {
readonly property bool isRedacted: model.event_type === "RedactedEvent"
readonly property bool onRight: ! eventList.ownEventsOnLeft && isOwn
readonly property bool combine: eventList.canCombine(previousModel, model)
readonly property bool asOneLine: eventList.renderEventAsOneLine(model)
readonly property bool talkBreak:
eventList.canTalkBreak(previousModel, model)
readonly property bool dayBreak:
eventList.canDayBreak(previousModel, model)
readonly property bool hideNameLine:
model.event_type === "RoomMessageEmote" ||
! (
model.event_type.startsWith("RoomMessage") ||
model.event_type.startsWith("RoomEncrypted")
) ||
onRight ||
combine
readonly property int cursorShape:
eventContent.hoveredLink ? Qt.PointingHandCursor :
eventContent.hoveredSelectable ? Qt.IBeamCursor :

View File

@@ -363,13 +363,6 @@ Rectangle {
return item.date.getDate() !== itemAfter.date.getDate()
}
function renderEventAsOneLine(event) {
return event.event_type === "RoomMessageEmote" || (
! event.event_type.startsWith("RoomMessage") &&
! event.event_type.startsWith("RoomEncrypted")
)
}
function loadPastEvents() {
loadPastEventsFutureId = py.callClientCoro(
chat.userId,