Open internal links from QML

This commit is contained in:
Christian Muehlhaeuser 2019-05-10 01:42:42 +02:00
parent b7e6d076be
commit f84075191c
No known key found for this signature in database
GPG key ID: 3CF9FA45CA1EBB7E

View file

@ -180,11 +180,18 @@ ColumnLayout {
visible: body.length > 0
text: "<style>a:link { visibility: hidden; text-decoration: none; color: " + Material.accent + "; }</style>" + body
textFormat: Text.RichText
onLinkActivated: Qt.openUrlExternally(link)
font.pointSize: 11
Layout.fillWidth: true
wrapMode: Text.WordWrap
opacity: (accountBridge.username == author && (like || forward)) ? 0.4 : 1.0
onLinkActivated: function(link) {
if (link.startsWith("telephant://")) {
var us = link.split("/")
uiBridge.loadAccount(us[us.length-1])
accountPopup.open()
} else
Qt.openUrlExternally(link)
}
MouseArea {
anchors.fill: parent