mirror of
https://github.com/muesli/telephant
synced 2024-11-22 11:23:05 +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
|
||||
persistentSelection: true
|
||||
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 {
|
||||
anchors.fill: parent
|
||||
// we don't want to eat clicks on the Label
|
||||
acceptedButtons: Qt.RightButton
|
||||
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.IBeamCursor
|
||||
hoverEnabled: true
|
||||
cursorShape: label.hoveredLink ? Qt.PointingHandCursor : Qt.IBeamCursor
|
||||
propagateComposedEvents: true
|
||||
|
||||
onReleased: {
|
||||
|
|
|
@ -236,28 +236,12 @@ ColumnLayout {
|
|||
MessageText {
|
||||
visible: message.body.length > 0 && (!message.sensitive || showSensitiveContent)
|
||||
text: "<style>a:link { visibility: hidden; text-decoration: none; color: " + Material.accent + "; }</style>" + message.body
|
||||
textFormat: Text.RichText
|
||||
font.pointSize: 11
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.WordWrap
|
||||
opacity: (accountBridge.username == message.author && (message.like || message.forward)) ? 0.4 : 1.0
|
||||
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() {
|
||||
uiBridge.loadConversation(message.messageid)
|
||||
ComponentCreator.createConversationPopup(this).open();
|
||||
|
|
Loading…
Reference in a new issue