From 4f723b42784d00c7bebbc73cadc227fa51e98fb8 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 --- ui/StatusQ/src/StatusQ/Components/StatusMessage.qml | 5 ++++- .../Components/private/statusMessage/StatusMessageHeader.qml | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/StatusQ/src/StatusQ/Components/StatusMessage.qml b/ui/StatusQ/src/StatusQ/Components/StatusMessage.qml index 0ad91935a8..504393cfba 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusMessage.qml +++ b/ui/StatusQ/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/ui/StatusQ/src/StatusQ/Components/private/statusMessage/StatusMessageHeader.qml b/ui/StatusQ/src/StatusQ/Components/private/statusMessage/StatusMessageHeader.qml index 2af8e27a7c..48e60dbfc4 100644 --- a/ui/StatusQ/src/StatusQ/Components/private/statusMessage/StatusMessageHeader.qml +++ b/ui/StatusQ/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)