2024-02-07 14:56:45 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Popups.Dialog 0.1
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
import shared.controls 1.0
|
2024-05-15 09:36:56 +00:00
|
|
|
import shared.popups 1.0
|
2024-02-13 14:10:07 +00:00
|
|
|
import shared.controls.chat 1.0
|
2024-02-07 14:56:45 +00:00
|
|
|
|
|
|
|
StatusDialog {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
required property string publicKey
|
|
|
|
required property string qrCode
|
|
|
|
required property string linkToProfile
|
|
|
|
|
2024-02-13 14:10:07 +00:00
|
|
|
required property string displayName
|
|
|
|
required property string largeImage
|
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
footer: null
|
|
|
|
|
|
|
|
width: 500
|
|
|
|
|
|
|
|
topPadding: Style.current.padding
|
|
|
|
bottomPadding: Style.current.xlPadding
|
2024-03-17 10:35:48 +00:00
|
|
|
horizontalPadding: 0
|
2024-02-13 14:10:07 +00:00
|
|
|
|
2024-03-17 10:35:48 +00:00
|
|
|
StatusScrollView {
|
|
|
|
anchors.fill: parent
|
|
|
|
contentWidth: availableWidth
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 40
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 40
|
|
|
|
spacing: Style.current.halfPadding
|
2024-02-13 14:10:07 +00:00
|
|
|
|
2024-03-17 10:35:48 +00:00
|
|
|
Rectangle {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: width
|
|
|
|
color: Theme.palette.white
|
|
|
|
|
|
|
|
Image {
|
2024-07-11 06:16:55 +00:00
|
|
|
objectName: "profileQRCodeImage"
|
2024-03-17 10:35:48 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
asynchronous: true
|
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
mipmap: true
|
|
|
|
smooth: false
|
|
|
|
source: root.qrCode
|
|
|
|
|
|
|
|
UserImage {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
name: root.displayName
|
|
|
|
pubkey: root.publicKey
|
|
|
|
image: root.largeImage
|
|
|
|
interactive: false
|
|
|
|
imageWidth: 78
|
|
|
|
imageHeight: 78
|
|
|
|
|
|
|
|
// show a hardcoded white ring
|
|
|
|
showRing: true
|
|
|
|
colorHash: JSON.stringify([{colorId: 4, segmentLength: 32}])
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
acceptedButtons: Qt.RightButton
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: qrContextMenu.popup()
|
|
|
|
}
|
|
|
|
|
|
|
|
ImageContextMenu {
|
|
|
|
id: qrContextMenu
|
|
|
|
imageSource: root.qrCode
|
|
|
|
}
|
2024-02-13 14:10:07 +00:00
|
|
|
}
|
2024-02-12 17:05:15 +00:00
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
|
2024-03-17 10:35:48 +00:00
|
|
|
StatusBaseText {
|
|
|
|
Layout.topMargin: Style.current.smallPadding
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: qsTr("Profile link")
|
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
|
2024-03-17 10:35:48 +00:00
|
|
|
StatusBaseInput {
|
2024-07-11 06:16:55 +00:00
|
|
|
objectName: "profileLinkInput"
|
2024-03-17 10:35:48 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: 44
|
|
|
|
leftPadding: Style.current.padding
|
|
|
|
rightPadding: Style.current.halfPadding
|
|
|
|
topPadding: 0
|
|
|
|
bottomPadding: 0
|
|
|
|
placeholder.rightPadding: Style.current.halfPadding
|
|
|
|
placeholder.elide: Text.ElideMiddle
|
|
|
|
placeholderText: root.linkToProfile
|
|
|
|
placeholderTextColor: Theme.palette.directColor1
|
|
|
|
edit.readOnly: true
|
|
|
|
background.color: "transparent"
|
|
|
|
background.border.color: Theme.palette.baseColor2
|
|
|
|
rightComponent: CopyButton {
|
|
|
|
textToCopy: root.linkToProfile
|
|
|
|
StatusToolTip {
|
|
|
|
text: qsTr("Copy link")
|
|
|
|
visible: parent.hovered
|
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-17 10:35:48 +00:00
|
|
|
StatusBaseText {
|
|
|
|
Layout.topMargin: Style.current.halfPadding
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: qsTr("Emoji hash")
|
2024-02-07 14:56:45 +00:00
|
|
|
}
|
2024-03-17 10:35:48 +00:00
|
|
|
|
|
|
|
StatusBaseInput {
|
2024-07-11 06:16:55 +00:00
|
|
|
objectName: "emojiHashInput"
|
2024-03-17 10:35:48 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: 44
|
|
|
|
leftPadding: Style.current.padding
|
|
|
|
rightPadding: Style.current.halfPadding
|
|
|
|
topPadding: 0
|
|
|
|
bottomPadding: 0
|
|
|
|
edit.readOnly: true
|
|
|
|
background.color: "transparent"
|
|
|
|
background.border.color: Theme.palette.baseColor2
|
|
|
|
leftComponent: EmojiHash {
|
|
|
|
publicKey: root.publicKey
|
|
|
|
oneRow: true
|
|
|
|
}
|
|
|
|
rightComponent: CopyButton {
|
|
|
|
textToCopy: Utils.getEmojiHashAsJson(root.publicKey).join("").toString()
|
|
|
|
StatusToolTip {
|
|
|
|
text: qsTr("Copy emoji hash")
|
|
|
|
visible: parent.hovered
|
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|