diff --git a/src/quick/qml/private/TextPart.qml b/src/quick/qml/private/TextPart.qml index 666d2dc..ad8d3c1 100644 --- a/src/quick/qml/private/TextPart.qml +++ b/src/quick/qml/private/TextPart.qml @@ -1,56 +1,56 @@ // SPDX-FileCopyrightText: 2016 Michael Bohlender // SPDX-FileCopyrightText: 2022 Carl Schwan // SPDX-License-Identifier: GPL-2.0-or-later import QtQuick 2.7 import QtQuick.Controls 2.15 as QQC2 import org.kde.pim.mimetreeparser 1.0 import org.kde.kirigami 2.19 as Kirigami Item { id: root property string content property bool embedded: true property bool autoLoadImages: false property string searchString property int contentHeight: textEdit.height onSearchStringChanged: { //This is a workaround because otherwise the view will not take the ViewHighlighter changes into account. textEdit.text = root.content } QQC2.TextArea { id: textEdit objectName: "textView" background: null readOnly: true textFormat: TextEdit.RichText wrapMode: TextEdit.Wrap padding: 0 anchors { left: parent.left right: parent.right top: parent.top } text: content.substring(0, 100000).replace(/\u00A0/g,' ') //The TextEdit deals poorly with messages that are too large. color: embedded ? Kirigami.Theme.disabledTextColor : Kirigami.Theme.textColor - onLinkActivated: Qt.openUrlExternally(link) + onLinkActivated: link => Qt.openUrlExternally(link) onHoveredLinkChanged: if (hoveredLink.length > 0) { applicationWindow().hoverLinkIndicator.text = hoveredLink; } else { applicationWindow().hoverLinkIndicator.text = ""; } //Kube.ViewHighlighter { // textDocument: textEdit.textDocument // searchString: root.searchString //} } }