summaryrefslogtreecommitdiff
path: root/kodereviewer/qml/MarkdownLabel.qml
diff options
context:
space:
mode:
Diffstat (limited to 'kodereviewer/qml/MarkdownLabel.qml')
-rw-r--r--kodereviewer/qml/MarkdownLabel.qml17
1 files changed, 17 insertions, 0 deletions
diff --git a/kodereviewer/qml/MarkdownLabel.qml b/kodereviewer/qml/MarkdownLabel.qml
new file mode 100644
index 0000000..1bf6b20
--- /dev/null
+++ b/kodereviewer/qml/MarkdownLabel.qml
@@ -0,0 +1,17 @@
+/* A for markdown rendering
+ * This Control accepts clicks for urls!
+ */
+import QtQml
+import QtQuick 6.7
+import QtQuick.Controls 6.7 as QQC2
+
+QQC2.Label {
+ textFormat: Text.MarkdownText
+ wrapMode: Text.WordWrap
+ onLinkActivated: link => Qt.openUrlExternally(link)
+ MouseArea {
+ anchors.fill: parent
+ acceptedButtons: Qt.NoButton // we don't want to eat clicks on the Text
+ cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
+ }
+}