2024-02-14 12:52:54 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2024-02-16 11:56:29 +00:00
|
|
|
import QtQml.Models 2.15
|
2024-02-14 12:52:54 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
2024-02-16 11:56:29 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2024-02-14 12:52:54 +00:00
|
|
|
import StatusQ.Popups.Dialog 0.1
|
2024-05-13 08:05:53 +00:00
|
|
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
2024-02-14 12:52:54 +00:00
|
|
|
|
|
|
|
import shared.controls 1.0
|
|
|
|
import shared.controls.chat 1.0
|
2024-10-22 12:39:42 +00:00
|
|
|
import shared.stores 1.0
|
|
|
|
import utils 1.0
|
2024-02-14 12:52:54 +00:00
|
|
|
|
|
|
|
StatusDialog {
|
|
|
|
id: root
|
|
|
|
|
2024-10-22 12:39:42 +00:00
|
|
|
required property UtilsStore utilsStore
|
|
|
|
|
2024-02-14 12:52:54 +00:00
|
|
|
required property string publicKey
|
|
|
|
required property var contactDetails
|
2024-02-26 18:54:05 +00:00
|
|
|
property bool loadingContactDetails
|
2024-02-14 12:52:54 +00:00
|
|
|
|
|
|
|
default property alias content: contentLayout.children
|
|
|
|
|
2024-02-16 11:56:29 +00:00
|
|
|
property ObjectModel rightButtons
|
|
|
|
|
2024-05-13 08:05:53 +00:00
|
|
|
readonly property string mainDisplayName: StatusQUtils.Emoji.parse(
|
|
|
|
ProfileUtils.displayName(contactDetails.localNickname, contactDetails.name,
|
|
|
|
contactDetails.displayName, contactDetails.alias))
|
|
|
|
readonly property string optionalDisplayName: StatusQUtils.Emoji.parse(
|
|
|
|
ProfileUtils.displayName("", contactDetails.name, contactDetails.displayName, contactDetails.alias))
|
2024-02-14 12:52:54 +00:00
|
|
|
|
2024-02-26 18:54:05 +00:00
|
|
|
width: Math.max(implicitWidth, 480)
|
2024-02-26 09:39:08 +00:00
|
|
|
horizontalPadding: 0
|
|
|
|
topPadding: 20
|
|
|
|
bottomPadding: 0
|
2024-02-14 12:52:54 +00:00
|
|
|
|
|
|
|
contentItem: ColumnLayout {
|
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.leftMargin: Theme.padding
|
|
|
|
Layout.rightMargin: Theme.padding
|
|
|
|
spacing: Theme.padding
|
2024-02-14 12:52:54 +00:00
|
|
|
|
|
|
|
UserImage {
|
2024-02-16 11:56:29 +00:00
|
|
|
name: root.mainDisplayName
|
2024-02-14 12:52:54 +00:00
|
|
|
pubkey: root.publicKey
|
|
|
|
image: Utils.addTimestampToURL(contactDetails.largeImage)
|
|
|
|
interactive: false
|
|
|
|
imageWidth: 60
|
|
|
|
imageHeight: 60
|
|
|
|
ensVerified: contactDetails.ensVerified
|
|
|
|
onlineStatus: contactDetails.onlineStatus
|
2024-02-26 18:54:05 +00:00
|
|
|
loading: root.loadingContactDetails
|
2024-02-14 12:52:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: contactRow
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: childrenRect.height
|
|
|
|
StatusBaseText {
|
|
|
|
id: contactName
|
|
|
|
anchors.left: parent.left
|
|
|
|
width: Math.min(implicitWidth, contactRow.width - verificationIcons.width - verificationIcons.anchors.leftMargin)
|
|
|
|
font.bold: true
|
|
|
|
font.pixelSize: 17
|
|
|
|
elide: Text.ElideRight
|
2024-02-16 11:56:29 +00:00
|
|
|
text: root.mainDisplayName
|
2024-02-14 12:52:54 +00:00
|
|
|
}
|
|
|
|
StatusContactVerificationIcons {
|
|
|
|
id: verificationIcons
|
|
|
|
anchors.left: contactName.right
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.leftMargin: Theme.halfPadding
|
2024-02-14 12:52:54 +00:00
|
|
|
anchors.verticalCenter: contactName.verticalCenter
|
|
|
|
isContact: contactDetails.isContact
|
|
|
|
trustIndicator: contactDetails.trustStatus
|
|
|
|
isBlocked: contactDetails.isBlocked
|
|
|
|
tiny: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RowLayout {
|
2024-10-15 19:26:12 +00:00
|
|
|
spacing: Theme.halfPadding
|
2024-02-14 12:52:54 +00:00
|
|
|
StatusBaseText {
|
|
|
|
id: contactSecondaryName
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
font.pixelSize: 13
|
2024-02-16 11:56:29 +00:00
|
|
|
text: root.optionalDisplayName
|
2024-02-14 12:52:54 +00:00
|
|
|
visible: !!contactDetails.localNickname
|
|
|
|
}
|
|
|
|
Rectangle {
|
|
|
|
Layout.preferredWidth: 4
|
|
|
|
Layout.preferredHeight: 4
|
|
|
|
radius: width/2
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
visible: contactSecondaryName.visible
|
|
|
|
}
|
|
|
|
StatusBaseText {
|
|
|
|
font.pixelSize: 13
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
text: Utils.getElidedCompressedPk(root.publicKey)
|
2024-02-16 11:56:29 +00:00
|
|
|
HoverHandler {
|
|
|
|
id: keyHoverHandler
|
|
|
|
}
|
|
|
|
StatusToolTip {
|
2024-10-28 23:00:16 +00:00
|
|
|
text: root.utilsStore.getCompressedPk(root.publicKey)
|
2024-02-16 11:56:29 +00:00
|
|
|
visible: keyHoverHandler.hovered
|
|
|
|
}
|
2024-02-14 12:52:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
EmojiHash {
|
|
|
|
Layout.topMargin: 4
|
2024-10-22 12:39:42 +00:00
|
|
|
emojiHash: root.utilsStore.getEmojiHash(root.publicKey)
|
2024-02-14 12:52:54 +00:00
|
|
|
oneRow: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusDialogDivider {
|
|
|
|
Layout.fillWidth: true
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.topMargin: Theme.padding
|
|
|
|
Layout.leftMargin: Theme.padding
|
|
|
|
Layout.rightMargin: Theme.padding
|
2024-02-14 12:52:54 +00:00
|
|
|
}
|
|
|
|
|
2024-02-26 09:39:08 +00:00
|
|
|
StatusScrollView {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
contentWidth: availableWidth
|
|
|
|
id: scrollView
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
width: scrollView.availableWidth
|
|
|
|
id: contentLayout
|
|
|
|
}
|
2024-02-14 12:52:54 +00:00
|
|
|
}
|
|
|
|
}
|
2024-02-16 11:56:29 +00:00
|
|
|
|
|
|
|
footer: StatusDialogFooter {
|
|
|
|
rightButtons: root.rightButtons
|
|
|
|
}
|
2024-02-14 12:52:54 +00:00
|
|
|
}
|