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
This commit is contained in:
Pascal Precht 2022-09-01 14:27:36 +02:00 committed by Michał Cieślak
parent 9769fdbb00
commit 4f723b4278
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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)