diff --git a/harmonyqml/components/base/RichLabel.qml b/harmonyqml/components/base/RichLabel.qml new file mode 100644 index 00000000..c454d9a8 --- /dev/null +++ b/harmonyqml/components/base/RichLabel.qml @@ -0,0 +1,23 @@ +import QtQuick 2.7 +import QtQuick.Controls 2.0 + +HLabel { + id: "label" + textFormat: Text.RichText + + MouseArea { + id: "mouseArea" + anchors.fill: parent + hoverEnabled: true + + onPositionChanged: function (event) { + cursorShape = label.linkAt(event.x, event.y) ? + Qt.PointingHandCursor : Qt.ArrowCursor + } + + onClicked: function(event) { + var link = label.linkAt(event.x, event.y) + if (link) { Qt.openUrlExternally(link) } + } + } +} diff --git a/harmonyqml/components/chat/MessageContent.qml b/harmonyqml/components/chat/MessageContent.qml index f13c18ef..dd94b010 100644 --- a/harmonyqml/components/chat/MessageContent.qml +++ b/harmonyqml/components/chat/MessageContent.qml @@ -30,7 +30,7 @@ Row { topPadding: verticalPadding } - Base.HLabel { + Base.RichLabel { id: contentLabel //text: (isOwn ? "" : content + "  ") + //"" +