mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-10 22:36:24 +00:00
fix: fix text selection by putting mouseArea under text
And put link click handling by the TextField itself
This commit is contained in:
parent
601d237fde
commit
a9cddde37e
@ -234,6 +234,7 @@ QtObject:
|
|||||||
|
|
||||||
proc joinChat*(self: ChatsView, channel: string, chatTypeInt: int): int {.slot.} =
|
proc joinChat*(self: ChatsView, channel: string, chatTypeInt: int): int {.slot.} =
|
||||||
self.status.chat.join(channel, ChatType(chatTypeInt))
|
self.status.chat.join(channel, ChatType(chatTypeInt))
|
||||||
|
self.setActiveChannel(channel)
|
||||||
|
|
||||||
proc joinGroup*(self: ChatsView) {.slot.} =
|
proc joinGroup*(self: ChatsView) {.slot.} =
|
||||||
self.status.chat.confirmJoiningGroup(self.activeChannel.id)
|
self.status.chat.confirmJoiningGroup(self.activeChannel.id)
|
||||||
|
@ -35,6 +35,7 @@ Rectangle {
|
|||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: chatReply.longReply ? parent.right : undefined
|
anchors.right: chatReply.longReply ? parent.right : undefined
|
||||||
|
z: 51
|
||||||
}
|
}
|
||||||
|
|
||||||
Separator {
|
Separator {
|
||||||
|
@ -12,6 +12,21 @@ StyledTextEdit {
|
|||||||
readOnly: true
|
readOnly: true
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
color: Style.current.textColor
|
color: Style.current.textColor
|
||||||
|
z: 51
|
||||||
|
onLinkActivated: function (link) {
|
||||||
|
if(link.startsWith("#")){
|
||||||
|
chatsModel.joinChat(link.substring(1), Constants.chatTypePublic);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (link.startsWith('//')) {
|
||||||
|
let pk = link.replace("//", "");
|
||||||
|
profileClick(chatsModel.userNameOrAlias(pk), pk, chatsModel.generateIdenticon(pk))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Qt.openUrlExternally(link)
|
||||||
|
}
|
||||||
text: {
|
text: {
|
||||||
if(contentType === Constants.stickerType) return "";
|
if(contentType === Constants.stickerType) return "";
|
||||||
let msg = Utils.linkifyAndXSS(message);
|
let msg = Utils.linkifyAndXSS(message);
|
||||||
@ -44,6 +59,5 @@ StyledTextEdit {
|
|||||||
`</body>`+
|
`</body>`+
|
||||||
`</html>`;
|
`</html>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,27 +3,14 @@ import "../../../../../shared"
|
|||||||
import "../../../../../imports"
|
import "../../../../../imports"
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
cursorShape: chatText.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
cursorShape: chatText.hoveredLink ? Qt.PointingHandCursor : undefined
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.RightButton
|
||||||
|
z: 50
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if(mouse.button & Qt.RightButton) {
|
if(mouse.button & Qt.RightButton) {
|
||||||
clickMessage()
|
clickMessage()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let link = chatText.hoveredLink;
|
|
||||||
if(link.startsWith("#")){
|
|
||||||
chatsModel.joinChat(link.substring(1), Constants.chatTypePublic);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (link.startsWith('//')) {
|
|
||||||
let pk = link.replace("//", "");
|
|
||||||
profileClick(chatsModel.userNameOrAlias(pk), pk, chatsModel.generateIdenticon(pk))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Qt.openUrlExternally(link)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user