mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-11 06:47:01 +00:00
fix(@desktop/timeline): can't click the links and hashtags in timeline
This commit is contained in:
parent
4d148b5c78
commit
1653e3bf20
@ -303,6 +303,9 @@ Item {
|
||||
readonly property int maxGapInSeconds: Constants.maxNbDaysToFetch * Constants.fetchRangeLast24Hours
|
||||
|
||||
visible: {
|
||||
if (!chatsModel.activeChannel) {
|
||||
return false
|
||||
}
|
||||
return gapNowAndOldest < maxGapInSeconds
|
||||
&& gapNowAndJoined > maxGapInSeconds
|
||||
&& (chatsModel.channelView.activeChannel.chatType !== Constants.chatTypePrivateGroupChat || chatsModel.channelView.activeChannel.isMember)
|
||||
|
@ -42,7 +42,7 @@ Item {
|
||||
color: Style.current.textColor
|
||||
height: root.veryLongChatText && !root.readMore ? Math.min(implicitHeight, 200) : implicitHeight
|
||||
clip: height < implicitHeight
|
||||
onLinkActivated: function (link) {
|
||||
onLinkActivated: {
|
||||
if(link.startsWith("#")) {
|
||||
const channelName = link.substring(1);
|
||||
const chatType = chatsModel.communities.activeCommunity.active ? Constants.chatTypeCommunity : Constants.chatTypePublic;
|
||||
@ -55,6 +55,7 @@ Item {
|
||||
appMain.changeAppSection(Constants.chat)
|
||||
}
|
||||
} else {
|
||||
appMain.changeAppSection(Constants.chat)
|
||||
chatsModel.channelView.setActiveChannel(channelName);
|
||||
}
|
||||
|
||||
|
@ -4,18 +4,29 @@ import "../../../../../shared"
|
||||
import "../../../../../imports"
|
||||
import "../../../../../shared/status"
|
||||
|
||||
Rectangle {
|
||||
MouseArea {
|
||||
id: root
|
||||
|
||||
property var clickMessage: function () {}
|
||||
property bool hovered: containsMouse
|
||||
property var container
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 0
|
||||
height: (isImage ? chatImageContent.height : chatText.height) + chatName.height + 2* Style.current.padding + (emojiReactions !== "" ? 20 : 0)
|
||||
width: parent.width
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
propagateComposedEvents: true
|
||||
onClicked: {
|
||||
mouse.accepted = false
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: rootRect
|
||||
anchors.fill: parent
|
||||
radius: Style.current.radius
|
||||
color: hovered ? Style.current.border : Style.current.background
|
||||
property bool hovered: false
|
||||
property var container
|
||||
color: root.hovered ? Style.current.border : Style.current.background
|
||||
|
||||
UserImage {
|
||||
id: chatImage
|
||||
@ -53,20 +64,6 @@ Rectangle {
|
||||
anchors.leftMargin: Style.current.halfPadding
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.current.padding
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
mouse.accepted = false
|
||||
}
|
||||
onEntered: {
|
||||
root.hovered = true
|
||||
}
|
||||
onExited: {
|
||||
root.hovered = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
@ -87,52 +84,24 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
propagateComposedEvents: true
|
||||
onEntered: {
|
||||
if (!root.hovered) {
|
||||
root.hovered = true
|
||||
}
|
||||
}
|
||||
onExited: {
|
||||
if (root.hovered) {
|
||||
root.hovered = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StatusIconButton {
|
||||
id: emojiBtn
|
||||
visible: root.hovered
|
||||
highlighted: visible
|
||||
anchors.top: root.top
|
||||
anchors.topMargin: -height/2
|
||||
anchors.right: root.right
|
||||
anchors.top: rootRect.top
|
||||
anchors.topMargin: -height / 4
|
||||
anchors.right: rootRect.right
|
||||
anchors.rightMargin: Style.current.halfPadding
|
||||
highlightedIconColor: Style.current.secondaryText
|
||||
highlightedBackgroundColor: Style.current.background
|
||||
icon.name: "emoji"
|
||||
icon.width: 20
|
||||
icon.height: 20
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: root.clickMessage(false, false, false, null, true)
|
||||
onEntered: {
|
||||
if (!root.hovered) {
|
||||
root.hovered = true
|
||||
}
|
||||
}
|
||||
onExited: {
|
||||
if (root.hovered) {
|
||||
root.hovered = false
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
root.clickMessage(false, false, false, null, true)
|
||||
}
|
||||
}
|
||||
|
||||
DropShadow {
|
||||
anchors.fill: emojiBtn
|
||||
horizontalOffset: 0
|
||||
@ -163,3 +132,4 @@ Rectangle {
|
||||
visible: !root.hovered
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -127,8 +127,8 @@ ScrollView {
|
||||
fromAuthor: model.fromAuthor
|
||||
chatId: model.chatId
|
||||
userName: model.userName
|
||||
localName: model.localName
|
||||
alias: model.alias
|
||||
localName: model.localName
|
||||
message: model.message
|
||||
plainText: model.plainText
|
||||
identicon: model.identicon
|
||||
|
Loading…
x
Reference in New Issue
Block a user