Add code blocks and python syntax highlighting.

This commit is contained in:
Adam Treat
2023-06-10 12:34:43 -04:00
committed by AT
parent b67cba19f0
commit 318c51c141
3 changed files with 277 additions and 24 deletions

View File

@@ -378,6 +378,12 @@ Window {
text: qsTr("Conversation copied to clipboard.")
}
PopupDialog {
id: copyCodeMessage
anchors.centerIn: parent
text: qsTr("Code copied to clipboard.")
}
PopupDialog {
id: healthCheckFailed
anchors.centerIn: parent
@@ -607,6 +613,10 @@ Window {
var integer = parseInt(link.split("://")[1]);
referenceContextDialog.text = referencesContext[integer - 1];
referenceContextDialog.open();
} else {
var success = responseText.tryCopyAtPosition(clickedPos);
if (success)
copyCodeMessage.open();
}
}
}
@@ -618,6 +628,7 @@ Window {
Component.onCompleted: {
responseText.textDocument = textDocument
responseText.setLinkColor(theme.linkColor);
responseText.setHeaderColor(theme.backgroundLight);
}
Accessible.role: Accessible.Paragraph