Warning, /plasma-mobile/spacebar/src/contents/ui/ChatDetailPage.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-FileCopyrightText: 2022 Michael Lang <criticaltemp@protonmail.com> 0002 // 0003 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0004 0005 import QtQuick 0006 import QtQuick.Layouts 0007 import QtQuick.Controls as Controls 0008 0009 import org.kde.kirigami as Kirigami 0010 import org.kde.kirigamiaddons.components as Components 0011 import org.kde.kirigamiaddons.delegates as Delegates 0012 0013 import org.kde.spacebar 0014 0015 Kirigami.ScrollablePage { 0016 title: i18n("Details") 0017 padding: 0 0018 0019 property var people 0020 0021 ListView { 0022 id: contactsList 0023 0024 header: Column { 0025 width: parent.width 0026 0027 Kirigami.Heading { 0028 level: 5 0029 type: Kirigami.Heading.Type.Primary 0030 Layout.fillWidth: true 0031 leftPadding: Kirigami.Units.largeSpacing * 2 0032 text: i18np("%1 person", "%1 people", people.length) 0033 color: Kirigami.Theme.disabledTextColor 0034 } 0035 0036 Delegates.RoundedItemDelegate { 0037 id: delegateItem 0038 width: parent.width 0039 implicitHeight: Kirigami.Units.iconSizes.medium + Kirigami.Units.largeSpacing * 2 0040 verticalPadding: 0 0041 contentItem: RowLayout { 0042 spacing: Kirigami.Units.largeSpacing 0043 0044 Rectangle { 0045 Layout.preferredWidth: Kirigami.Units.iconSizes.medium 0046 Layout.preferredHeight: Kirigami.Units.iconSizes.medium 0047 radius: width / 2 0048 border.color: Kirigami.Theme.linkColor 0049 border.width: 2 0050 color: "transparent" 0051 0052 Text { 0053 anchors.centerIn: parent 0054 text: "+" 0055 color: Kirigami.Theme.linkColor 0056 font.bold: true 0057 font.pixelSize: parent.height / 1.5 0058 } 0059 } 0060 0061 Controls.Label { 0062 Layout.fillWidth: true 0063 text: i18n("Add people") 0064 color: Kirigami.Theme.textColor 0065 } 0066 } 0067 onClicked: pageStack.push("qrc:/NewConversationPage.qml", { selected: people.slice() }) 0068 } 0069 } 0070 0071 clip: true 0072 reuseItems: false 0073 currentIndex: -1 0074 0075 model: people 0076 0077 delegate: Delegates.RoundedItemDelegate { 0078 id: delegateItem 0079 width: contactsList.width 0080 implicitHeight: Kirigami.Units.iconSizes.medium + Kirigami.Units.largeSpacing * 2 0081 verticalPadding: 0 0082 contentItem: RowLayout { 0083 spacing: Kirigami.Units.largeSpacing 0084 0085 Components.Avatar { 0086 Layout.preferredWidth: Kirigami.Units.iconSizes.medium 0087 Layout.preferredHeight: Kirigami.Units.iconSizes.medium 0088 source: modelData.phoneNumber ? "image://avatar/" + modelData.phoneNumber : "" 0089 name: modelData.name 0090 imageMode: Components.Avatar.ImageMode.AdaptiveImageOrInitals 0091 } 0092 0093 ColumnLayout { 0094 Layout.fillWidth: true 0095 spacing: 0 0096 0097 Controls.Label { 0098 id: labelItem 0099 Layout.fillWidth: true 0100 Layout.alignment: subtitleItem.visible ? Qt.AlignLeft | Qt.AlignBottom : Qt.AlignLeft | Qt.AlignVCenter 0101 text: modelData.name || Utils.phoneNumberToInternationalString(Utils.phoneNumber(modelData.phoneNumber)) 0102 elide: Text.ElideRight 0103 color: Kirigami.Theme.textColor 0104 } 0105 Controls.Label { 0106 id: subtitleItem 0107 visible: text 0108 Layout.fillWidth: true 0109 Layout.alignment: Qt.AlignLeft | Qt.AlignTop 0110 text: modelData.name ? Utils.phoneNumberToInternationalString(Utils.phoneNumber(modelData.phoneNumber)) : "" 0111 elide: Text.ElideRight 0112 color: Kirigami.Theme.textColor 0113 opacity: 0.7 0114 font: Kirigami.Theme.smallFont 0115 } 0116 } 0117 } 0118 onPressAndHold: { 0119 showPassiveNotification("Number copied to clipboard", 3000); 0120 Utils.copyTextToClipboard(modelData.phoneNumber) 0121 } 0122 onClicked: Utils.launchPhonebook() 0123 } 0124 } 0125 }