2020-07-21 21:03:22 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import QtGraphicalEffects 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.popups 1.0
|
2022-03-16 21:20:03 +00:00
|
|
|
import shared.controls.chat 1.0
|
2020-07-21 21:03:22 +00:00
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
import "../popups"
|
2021-12-30 12:39:47 +00:00
|
|
|
import "../stores"
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
2021-09-09 14:03:17 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
2021-10-18 10:34:16 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2021-09-09 14:03:17 +00:00
|
|
|
|
2022-03-16 21:20:03 +00:00
|
|
|
ColumnLayout {
|
2021-10-06 09:16:39 +00:00
|
|
|
id: root
|
|
|
|
|
2021-12-30 12:39:47 +00:00
|
|
|
property ProfileStore profileStore
|
2021-12-29 15:09:29 +00:00
|
|
|
property int profileContentWidth
|
2020-07-21 21:03:22 +00:00
|
|
|
|
2021-04-08 15:44:58 +00:00
|
|
|
clip: true
|
2022-03-16 21:20:03 +00:00
|
|
|
spacing: 16
|
2020-07-21 21:03:22 +00:00
|
|
|
|
|
|
|
Item {
|
2022-03-16 21:20:03 +00:00
|
|
|
Layout.preferredHeight: 32
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2020-11-30 17:03:52 +00:00
|
|
|
|
2022-03-16 21:20:03 +00:00
|
|
|
RowLayout {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.maximumWidth: root.profileContentWidth
|
2020-07-21 21:03:22 +00:00
|
|
|
|
2021-10-06 09:16:39 +00:00
|
|
|
StatusBaseText {
|
2020-07-21 21:03:22 +00:00
|
|
|
id: profileName
|
2022-03-16 21:20:03 +00:00
|
|
|
|
2021-12-29 15:09:29 +00:00
|
|
|
text: root.profileStore.name
|
2020-12-29 18:18:50 +00:00
|
|
|
font.weight: Font.Bold
|
|
|
|
font.pixelSize: 20
|
2021-10-06 09:16:39 +00:00
|
|
|
color: Theme.palette.directColor1
|
2020-07-21 21:03:22 +00:00
|
|
|
}
|
|
|
|
|
2022-03-02 00:14:20 +00:00
|
|
|
StatusButton {
|
|
|
|
text: "Edit"
|
2022-03-16 21:20:03 +00:00
|
|
|
onClicked: Global.openPopup(displayNamePopupComponent)
|
2022-03-02 00:14:20 +00:00
|
|
|
}
|
|
|
|
|
2022-03-16 21:20:03 +00:00
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
2020-07-21 21:03:22 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 10:34:16 +00:00
|
|
|
StatusFlatRoundButton {
|
2020-12-04 18:19:52 +00:00
|
|
|
id: qrCodeButton
|
2022-03-16 21:20:03 +00:00
|
|
|
|
|
|
|
Layout.preferredWidth: 32
|
|
|
|
Layout.preferredHeight: 32
|
|
|
|
|
2021-10-18 10:34:16 +00:00
|
|
|
icon.name: "qr"
|
|
|
|
type: StatusFlatRoundButton.Type.Quaternary
|
|
|
|
onClicked: qrCodePopup.open()
|
2020-07-22 20:16:06 +00:00
|
|
|
}
|
2022-03-16 21:20:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.preferredWidth: root.profileContentWidth
|
|
|
|
}
|
|
|
|
|
|
|
|
ProfileHeader {
|
|
|
|
id: profileImgNameContainer
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.preferredWidth: root.profileContentWidth
|
|
|
|
|
|
|
|
displayName: profileStore.name
|
|
|
|
pubkey: profileStore.pubkey
|
|
|
|
icon: profileStore.icon
|
|
|
|
isIdenticon: profileStore.isIdenticon
|
|
|
|
|
|
|
|
displayNameVisible: false
|
|
|
|
pubkeyVisible: false
|
2020-07-21 21:03:22 +00:00
|
|
|
|
2022-03-16 21:20:03 +00:00
|
|
|
imageWidth: 80
|
|
|
|
imageHeight: 80
|
|
|
|
emojiSize: "20x20"
|
|
|
|
|
|
|
|
imageOverlay: Item {
|
|
|
|
StatusFlatRoundButton {
|
|
|
|
width: 24
|
|
|
|
height: 24
|
|
|
|
|
|
|
|
anchors {
|
|
|
|
right: parent.right
|
|
|
|
bottom: parent.bottom
|
|
|
|
rightMargin: -8
|
|
|
|
}
|
|
|
|
|
|
|
|
type: StatusFlatRoundButton.Type.Secondary
|
|
|
|
icon.name: "pencil"
|
|
|
|
icon.color: Theme.palette.directColor1
|
|
|
|
icon.width: 12.5
|
|
|
|
icon.height: 12.5
|
|
|
|
|
|
|
|
onClicked: Global.openChangeProfilePicPopup()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusDescriptionListItem {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.preferredWidth: root.profileContentWidth
|
|
|
|
|
|
|
|
title: qsTr("ENS username")
|
|
|
|
subTitle: root.profileStore.ensName
|
|
|
|
tooltip.text: qsTr("Copy to clipboard")
|
|
|
|
icon.name: "copy"
|
|
|
|
visible: !!root.profileStore.ensName
|
|
|
|
iconButton.onClicked: {
|
|
|
|
root.profileStore.copyToClipboard(root.profileStore.ensName)
|
|
|
|
tooltip.visible = !tooltip.visible
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusDescriptionListItem {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.preferredWidth: root.profileContentWidth
|
|
|
|
|
|
|
|
title: qsTr("Chat key")
|
|
|
|
subTitle: root.profileStore.pubkey
|
|
|
|
subTitleComponent.elide: Text.ElideMiddle
|
|
|
|
subTitleComponent.width: 320
|
|
|
|
subTitleComponent.font.family: Theme.palette.monoFont.name
|
|
|
|
tooltip.text: qsTr("Copy to clipboard")
|
|
|
|
icon.name: "copy"
|
|
|
|
iconButton.onClicked: {
|
|
|
|
root.profileStore.copyToClipboard(root.profileStore.pubkey)
|
|
|
|
tooltip.visible = !tooltip.visible
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusDescriptionListItem {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.preferredWidth: root.profileContentWidth
|
|
|
|
|
|
|
|
title: qsTr("Share Profile URL")
|
|
|
|
subTitle: `${Constants.userLinkPrefix}${root.profileStore.ensName !== "" ? root.profileStore.ensName : (root.profileStore.pubkey.substring(0, 5) + "..." + root.profileStore.pubkey.substring(root.profileStore.pubkey.length - 5))}`
|
|
|
|
tooltip.text: qsTr("Copy to clipboard")
|
|
|
|
icon.name: "copy"
|
|
|
|
iconButton.onClicked: {
|
|
|
|
root.profileStore.copyToClipboard(Constants.userLinkPrefix + (root.profileStore.ensName !== "" ? root.profileStore.ensName : root.profileStore.pubkey))
|
|
|
|
tooltip.visible = !tooltip.visible
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: displayNamePopupComponent
|
|
|
|
DisplayNamePopup {
|
|
|
|
profileStore: root.profileStore
|
|
|
|
onClosed: {
|
|
|
|
destroy()
|
|
|
|
}
|
2020-07-21 21:03:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-04 18:19:52 +00:00
|
|
|
ModalPopup {
|
|
|
|
id: qrCodePopup
|
|
|
|
width: 420
|
|
|
|
height: 420
|
2020-08-19 21:01:22 +00:00
|
|
|
Image {
|
|
|
|
asynchronous: true
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2021-12-29 15:09:29 +00:00
|
|
|
source: root.profileStore.getQrCodeSource(root.profileStore.pubkey)
|
2020-12-29 18:18:50 +00:00
|
|
|
anchors.verticalCenterOffset: 20
|
2020-08-19 21:01:22 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2020-12-29 18:18:50 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2020-12-04 18:19:52 +00:00
|
|
|
height: 312
|
|
|
|
width: 312
|
2020-08-19 21:01:22 +00:00
|
|
|
mipmap: true
|
|
|
|
smooth: false
|
|
|
|
}
|
|
|
|
}
|
2020-07-21 21:03:22 +00:00
|
|
|
}
|
|
|
|
|