// SPDX-FileCopyrightText: 2018-2020 Black Hat // SPDX-License-Identifier: GPL-3.0-only import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 import org.kde.kirigami 2.15 as Kirigami import NeoChat.Component 1.0 import NeoChat.Dialog 1.0 Control { x: Kirigami.Units.gridUnit * 1.5 + Kirigami.Units.smallSpacing width: ListView.view.width - Kirigami.Units.largeSpacing - x height: sectionDelegate.height + rowLayout.height SectionDelegate { id: sectionDelegate width: parent.width anchors.top: parent.top anchors.leftMargin: Kirigami.Units.smallSpacing visible: model.showSection height: visible ? implicitHeight : 0 } RowLayout { id: rowLayout height: label.contentHeight width: parent.width anchors.bottom: parent.bottom Kirigami.Avatar { id: icon Layout.preferredWidth: Kirigami.Units.iconSizes.small Layout.preferredHeight: Kirigami.Units.iconSizes.small Layout.alignment: Qt.AlignTop name: author.displayName source: author.avatarMediaId ? ("image://mxc/" + author.avatarMediaId) : "" color: author.color Component { id: userDetailDialog UserDetailDialog {} } MouseArea { anchors.fill: parent onClicked: userDetailDialog.createObject(ApplicationWindow.overlay, {room: currentRoom, user: author.object, displayName: author.displayName, avatarMediaId: author.avatarMediaId, avatarUrl: author.avatarUrl}).open() } } Label { id: label Layout.alignment: Qt.AlignVCenter Layout.fillWidth: true Layout.preferredHeight: icon.height wrapMode: Text.WordWrap textFormat: Text.RichText text: `${currentRoom.htmlSafeMemberName(author.id)} ${aggregateDisplay}` onLinkActivated: userDetailDialog.createObject(ApplicationWindow.overlay, {room: currentRoom, user: author.object, displayName: author.displayName, avatarMediaId: author.avatarMediaId, avatarUrl: author.avatarUrl}).open() } } }