Make drawer text selectable

Fix bug #140
This commit is contained in:
Carl Schwan
2020-12-15 17:57:39 +01:00
parent 24fac27a7f
commit 049a1b3528

View File

@@ -133,14 +133,22 @@ Kirigami.OverlayDrawer {
}
}
Label {
TextEdit {
Layout.maximumWidth: Kirigami.Units.gridUnit * 13
Layout.preferredWidth: Kirigami.Units.gridUnit * 13
Layout.fillWidth: true
Kirigami.FormData.label: i18n("Topic:")
text: room && room.topic ? room.topic : i18n("No Topic")
elide: Text.ElideRight
text: room && room.topic ? room.topic.replace(replaceLinks, "<a href=\"$1\">$1</a>") : i18n("No Topic")
readonly property var replaceLinks: /\(https:\/\/[^ ]*\)/
textFormat: TextEdit.MarkdownText
wrapMode: Text.WordWrap
selectByMouse: true
color: Kirigami.Theme.textColor
onLinkActivated: Qt.openUrlExternally(link)
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.IBeamCursor
}
}
}
}