import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../../Base" import "../../utils.js" as Utils HRowLayout { id: eventContent spacing: theme.spacing / 1.25 layoutDirection: onRight ? Qt.RightToLeft: Qt.LeftToRight readonly property string eventText: Utils.processedEventText(model) readonly property string eventTime: Utils.formatTime(model.date, false) readonly property bool pureMedia: ! eventText && linksRepeater.count readonly property string hoveredLink: contentLabel.hoveredLink readonly property bool hoveredSelectable: contentHover.hovered readonly property int messageBodyWidth: width - (avatarWrapper.visible ? avatarWrapper.width : 0) - totalSpacing readonly property int xOffset: onRight ? contentLabel.width - contentLabel.paintedWidth - contentLabel.leftPadding - contentLabel.rightPadding : 0 TapHandler { enabled: debugMode onDoubleTapped: Utils.debug(eventContent, con => { con.runJS("json()") }) } Item { id: avatarWrapper opacity: collapseAvatar ? 0 : 1 visible: ! hideAvatar Layout.minimumWidth: 58 Layout.minimumHeight: collapseAvatar ? 1 : smallAvatar ? 28 : 58 Layout.maximumWidth: Layout.minimumWidth Layout.maximumHeight: Layout.minimumHeight Layout.alignment: Qt.AlignTop HUserAvatar { id: avatar userId: model.sender_id displayName: model.sender_name avatarUrl: model.sender_avatar width: parent.width height: collapseAvatar ? 1 : 58 } } HColumnLayout { id: contentColumn Layout.alignment: Qt.AlignVCenter HSelectableLabel { id: contentLabel container: selectableLabelContainer index: model.index topPadding: theme.spacing / 1.75 bottomPadding: topPadding leftPadding: eventContent.spacing rightPadding: leftPadding color: theme.chat.message.body wrapMode: TextEdit.Wrap textFormat: Text.RichText text: // CSS theme.chat.message.styleInclude + // Sender name (hideNameLine ? "" : ( "