diff --git a/src/app/mainview/components/ChatViewHeader.qml b/src/app/mainview/components/ChatViewHeader.qml index 12b6c24c2e54ef4e457a742901286495d66137b0..60e8e3b9ce7309f7ad5a053a10d1219c2a0e42d8 100644 --- a/src/app/mainview/components/ChatViewHeader.qml +++ b/src/app/mainview/components/ChatViewHeader.qml @@ -116,6 +116,20 @@ Rectangle { spacing: 0 + LineEditContextMenu { + id: displayNameContextMenu + lineEditObj: title + selectOnly: true + } + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.RightButton + cursorShape: Qt.IBeamCursor + onClicked: function (mouse) { + displayNameContextMenu.openMenuAt(mouse); + } + } + ElidedTextLabel { id: title diff --git a/src/app/mainview/components/UserProfile.qml b/src/app/mainview/components/UserProfile.qml index ac298364a3f994a9b363ccd60f8b82b2ae11abd9..22aa8898fc18cce8bb32e0c61101b6371b9a78c3 100644 --- a/src/app/mainview/components/UserProfile.qml +++ b/src/app/mainview/components/UserProfile.qml @@ -38,7 +38,7 @@ BaseModalDialog { height: userProfileDialogLayout.height + 10 radius: 5 - Rectangle{ + Rectangle { id: qrImageBackground radius: 5 anchors.right: parent.right @@ -90,8 +90,7 @@ BaseModalDialog { spacing: 10 Layout.alignment: Qt.AlignLeft - // Visible when user alias is not empty and not equal to id. - TextEdit { + Text { id: contactAlias Layout.alignment: Qt.AlignLeft @@ -99,22 +98,19 @@ BaseModalDialog { font.kerning: true color: JamiTheme.textColor - visible: aliasText ? (aliasText === idText ? false : true) : false - - selectByMouse: true - readOnly: true + visible: true text: textMetricsContactAliasText.elidedText horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter + } - TextMetrics { - id: textMetricsContactAliasText - font: contactAlias.font - text: aliasText - elideWidth: userProfileDialogLayout.width - qrImageBackground.width - 100 - elide: Qt.ElideRight - } + TextMetrics { + id: textMetricsContactAliasText + font: contactAlias.font + text: aliasText + elideWidth: userProfileDialogLayout.width - qrImageBackground.width - 100 + elide: Qt.ElideRight } // Visible when user name is not empty or equals to id. @@ -135,6 +131,21 @@ BaseModalDialog { horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter + LineEditContextMenu { + id: displayNameContextMenu + lineEditObj: contactDisplayName + selectOnly: true + } + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.RightButton + cursorShape: Qt.IBeamCursor + onClicked: function (mouse) { + displayNameContextMenu.openMenuAt(mouse); + } + } + TextMetrics { id: textMetricsContactDisplayNameText font: contactDisplayName.font @@ -146,8 +157,6 @@ BaseModalDialog { } } - - Rectangle { id: idRectangle @@ -181,7 +190,7 @@ BaseModalDialog { TextEdit { id: contactId Layout.alignment: Qt.AlignLeft - Layout.minimumWidth: 400 - identifierText.width - 2 * root.popupMargins - 35 + Layout.minimumWidth: 400 - identifierText.width - copyButton.width - 2 * root.popupMargins - 35 font.pointSize: JamiTheme.textFontSize font.kerning: true @@ -191,6 +200,21 @@ BaseModalDialog { readOnly: true text: textMetricsContacIdText.elidedText + LineEditContextMenu { + id: idContextMenu + lineEditObj: contactId + selectOnly: true + } + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.RightButton + cursorShape: Qt.IBeamCursor + onClicked: function (mouse) { + idContextMenu.openMenuAt(mouse); + } + } + TextMetrics { id: textMetricsContacIdText font: contactDisplayName.font @@ -202,9 +226,25 @@ BaseModalDialog { horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter } + + PushButton { + id: copyButton + preferredHeight: 24 + preferredWidth: 24 + circled: false + radius: 3 + + toolTipText: JamiStrings.copy + source: JamiResources.copy_svg + + onClicked: { + contactId.selectAll(); + contactId.copy(); + contactId.deselect(); + } + } } } } } } -