Warning, /network/neochat/src/qml/TimelineEndDelegate.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2023 James Graham <james.h.graham@protonmail.com>
0002 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0003 
0004 import QtQuick
0005 import QtQuick.Layouts
0006 
0007 import org.kde.kirigami as Kirigami
0008 import org.kde.kirigamiaddons.labs.components as KirigamiComponents
0009 
0010 import org.kde.neochat
0011 
0012 TimelineDelegate {
0013     id: root
0014 
0015     /**
0016      * @brief The current room that user is viewing.
0017      */
0018     required property NeoChatRoom room
0019 
0020     contentItem: ColumnLayout {
0021         RowLayout {
0022             Layout.topMargin: Kirigami.Units.largeSpacing
0023             Layout.bottomMargin: Kirigami.Units.largeSpacing
0024             Layout.leftMargin: Kirigami.Units.largeSpacing
0025             Layout.rightMargin: Kirigami.Units.largeSpacing
0026             spacing: Kirigami.Units.largeSpacing
0027 
0028             KirigamiComponents.Avatar {
0029                 Layout.preferredWidth: Kirigami.Units.iconSizes.large
0030                 Layout.preferredHeight: Kirigami.Units.iconSizes.large
0031 
0032                 name: root.room ? root.room.displayName : ""
0033                 source: root.room && root.room.avatarMediaId ? ("image://mxc/" + root.room.avatarMediaId) : ""
0034 
0035                 Rectangle {
0036                     visible: room.usesEncryption
0037                     color: Kirigami.Theme.backgroundColor
0038 
0039                     width: Kirigami.Units.gridUnit
0040                     height: Kirigami.Units.gridUnit
0041 
0042                     anchors {
0043                         bottom: parent.bottom
0044                         right: parent.right
0045                     }
0046 
0047                     radius: Math.round(width / 2)
0048 
0049                     Kirigami.Icon {
0050                         source: "channel-secure-symbolic"
0051                         anchors.fill: parent
0052                     }
0053                 }
0054             }
0055 
0056             ColumnLayout {
0057                 Layout.fillWidth: true
0058                 Layout.alignment: Qt.AlignVCenter
0059                 spacing: 0
0060 
0061                 Kirigami.Heading {
0062                     Layout.fillWidth: true
0063                     text: root.room ? root.room.displayName : i18n("No name")
0064                     textFormat: Text.PlainText
0065                     wrapMode: Text.Wrap
0066                 }
0067 
0068                 Kirigami.SelectableLabel {
0069                     Layout.fillWidth: true
0070                     font: Kirigami.Theme.smallFont
0071                     textFormat: TextEdit.PlainText
0072                     visible: root.room && root.room.canonicalAlias
0073                     text: root.room && root.room.canonicalAlias ? root.room.canonicalAlias : ""
0074                 }
0075             }
0076         }
0077 
0078         Kirigami.SelectableLabel {
0079             Layout.fillWidth: true
0080             Layout.leftMargin: Kirigami.Units.largeSpacing
0081             Layout.rightMargin: Kirigami.Units.largeSpacing
0082             Layout.bottomMargin: Kirigami.Units.largeSpacing
0083 
0084             text: i18n("This is the beginning of the chat. There are no historical messages beyond this point.")
0085             wrapMode: Text.Wrap
0086             onLinkActivated: link => UrlHelper.openUrl(link)
0087         }
0088     }
0089 }