mirror of
https://github.com/muesli/telephant
synced 2025-02-16 19:48:24 +00:00
Don't swallow hover-events over MessageText
This commit is contained in:
parent
61f0939f5e
commit
7474a6fc66
2 changed files with 16 additions and 18 deletions
|
@ -11,13 +11,27 @@ TextEdit
|
||||||
readOnly: true
|
readOnly: true
|
||||||
persistentSelection: true
|
persistentSelection: true
|
||||||
selectionColor: Material.accent
|
selectionColor: Material.accent
|
||||||
|
textFormat: Text.RichText
|
||||||
|
|
||||||
|
onLinkActivated: function(link) {
|
||||||
|
if (link.startsWith("telephant://")) {
|
||||||
|
var us = link.substr(12, link.length).split("/")
|
||||||
|
if (us[1] == "user") {
|
||||||
|
uiBridge.loadAccount(us[us.length-1])
|
||||||
|
ComponentCreator.createAccountPopup(this).open();
|
||||||
|
}
|
||||||
|
if (us[1] == "tag") {
|
||||||
|
uiBridge.tag(us[us.length-1])
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
Qt.openUrlExternally(link)
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
// we don't want to eat clicks on the Label
|
// we don't want to eat clicks on the Label
|
||||||
acceptedButtons: Qt.RightButton
|
acceptedButtons: Qt.RightButton
|
||||||
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.IBeamCursor
|
cursorShape: label.hoveredLink ? Qt.PointingHandCursor : Qt.IBeamCursor
|
||||||
hoverEnabled: true
|
|
||||||
propagateComposedEvents: true
|
propagateComposedEvents: true
|
||||||
|
|
||||||
onReleased: {
|
onReleased: {
|
||||||
|
|
|
@ -236,28 +236,12 @@ ColumnLayout {
|
||||||
MessageText {
|
MessageText {
|
||||||
visible: message.body.length > 0 && (!message.sensitive || showSensitiveContent)
|
visible: message.body.length > 0 && (!message.sensitive || showSensitiveContent)
|
||||||
text: "<style>a:link { visibility: hidden; text-decoration: none; color: " + Material.accent + "; }</style>" + message.body
|
text: "<style>a:link { visibility: hidden; text-decoration: none; color: " + Material.accent + "; }</style>" + message.body
|
||||||
textFormat: Text.RichText
|
|
||||||
font.pointSize: 11
|
font.pointSize: 11
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
opacity: (accountBridge.username == message.author && (message.like || message.forward)) ? 0.4 : 1.0
|
opacity: (accountBridge.username == message.author && (message.like || message.forward)) ? 0.4 : 1.0
|
||||||
color: "white"
|
color: "white"
|
||||||
|
|
||||||
onLinkActivated: function(link) {
|
|
||||||
if (link.startsWith("telephant://")) {
|
|
||||||
var us = link.substr(12, link.length).split("/")
|
|
||||||
|
|
||||||
if (us[1] == "user") {
|
|
||||||
uiBridge.loadAccount(us[us.length-1])
|
|
||||||
ComponentCreator.createAccountPopup(this).open();
|
|
||||||
}
|
|
||||||
if (us[1] == "tag") {
|
|
||||||
uiBridge.tag(us[us.length-1])
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
Qt.openUrlExternally(link)
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: function() {
|
onClicked: function() {
|
||||||
uiBridge.loadConversation(message.messageid)
|
uiBridge.loadConversation(message.messageid)
|
||||||
ComponentCreator.createConversationPopup(this).open();
|
ComponentCreator.createConversationPopup(this).open();
|
||||||
|
|
Loading…
Add table
Reference in a new issue