2019-07-08 13:52:41 +10:00
|
|
|
// Copyright 2019 miruka
|
|
|
|
// This file is part of harmonyqml, licensed under LGPLv3.
|
|
|
|
|
2019-04-18 00:54:55 +10:00
|
|
|
import QtQuick 2.7
|
|
|
|
|
|
|
|
HLabel {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: label
|
2019-04-18 00:54:55 +10:00
|
|
|
textFormat: Text.RichText
|
|
|
|
|
|
|
|
MouseArea {
|
2019-04-21 07:45:51 +10:00
|
|
|
id: mouseArea
|
2019-04-18 00:54:55 +10:00
|
|
|
anchors.fill: parent
|
|
|
|
hoverEnabled: true
|
2019-07-05 09:23:40 +10:00
|
|
|
propagateComposedEvents: true
|
2019-04-18 00:54:55 +10:00
|
|
|
|
2019-07-05 15:54:29 +10:00
|
|
|
onPositionChanged: function (mouse) {
|
|
|
|
mouse.accepted = false
|
|
|
|
cursorShape = label.linkAt(mouse.x, mouse.y) ?
|
2019-04-18 00:54:55 +10:00
|
|
|
Qt.PointingHandCursor : Qt.ArrowCursor
|
|
|
|
}
|
|
|
|
|
2019-07-05 15:54:29 +10:00
|
|
|
onClicked: function(mouse) {
|
|
|
|
var link = label.linkAt(mouse.x, mouse.y)
|
|
|
|
mouse.accepted = Boolean(link)
|
2019-04-18 00:54:55 +10:00
|
|
|
if (link) { Qt.openUrlExternally(link) }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|