From ad8bc322d16bd7f60feb9ea70c57beb2076a5a26 Mon Sep 17 00:00:00 2001 From: Pascal Precht <445106+PascalPrecht@users.noreply.github.com> Date: Thu, 1 Sep 2022 14:27:36 +0200 Subject: [PATCH] feat(StatusMessage): introduce `profileClickable` property This property allows for enabling/disabling whether or not the profile picture and display name of a message is clickable and also dictates the cursor type accordingly. The reason this is being introduced is that, with imported messages from other systems (e.g. discord, telegram etc), we don't want the user to trigger the popup menu for more profile information because we don't know any profile information of messages coming from such systems. Such messages are signed by the community. Closes https://github.com/status-im/status-desktop/issues/6680 --- src/StatusQ/Components/StatusMessage.qml | 5 ++++- .../Components/private/statusMessage/StatusMessageHeader.qml | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/StatusQ/Components/StatusMessage.qml b/src/StatusQ/Components/StatusMessage.qml index 0ad91935..504393cf 100644 --- a/src/StatusQ/Components/StatusMessage.qml +++ b/src/StatusQ/Components/StatusMessage.qml @@ -67,6 +67,7 @@ Rectangle { property bool hideQuickActions: false property color overrideBackgroundColor: "transparent" property bool overrideBackground: false + property bool profileClickable: true property alias previousMessageIndex: dateGroupLabel.previousMessageIndex property alias previousMessageTimestamp: dateGroupLabel.previousMessageTimestamp @@ -242,9 +243,10 @@ Rectangle { ringSettings: root.messageDetails.sender.profileImage.ringSettings MouseArea { - cursorShape: Qt.PointingHandCursor + cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor acceptedButtons: Qt.LeftButton | Qt.RightButton anchors.fill: parent + enabled: root.profileClickable onClicked: root.profilePictureClicked(this, mouse) } } @@ -275,6 +277,7 @@ Rectangle { visible: root.showHeader && !editMode timestamp.text: root.timestampString timestamp.tooltip.text: root.timestampTooltipString + displayNameClickable: root.profileClickable } Loader { Layout.fillWidth: true diff --git a/src/StatusQ/Components/private/statusMessage/StatusMessageHeader.qml b/src/StatusQ/Components/private/statusMessage/StatusMessageHeader.qml index 2af8e27a..48e60dbf 100644 --- a/src/StatusQ/Components/private/statusMessage/StatusMessageHeader.qml +++ b/src/StatusQ/Components/private/statusMessage/StatusMessageHeader.qml @@ -23,6 +23,7 @@ Item { property bool isContact: sender.isContact property int trustIndicator: sender.trustIndicator property bool amISender: false + property bool displayNameClickable: true property string messageOriginInfo: "" signal clicked(var sender, var mouse) @@ -49,8 +50,9 @@ Item { MouseArea { id: mouseArea anchors.fill: parent - cursorShape: Qt.PointingHandCursor + cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor acceptedButtons: Qt.LeftButton | Qt.RightButton + enabled: root.displayNameClickable hoverEnabled: true onClicked: { root.clicked(this, mouse)