Add context link to references.

This commit is contained in:
Adam Treat
2023-05-25 10:40:10 -04:00
committed by AT
parent db9eecdce4
commit 9b0629db8b
4 changed files with 49 additions and 8 deletions

View File

@@ -555,6 +555,14 @@ Window {
}
}
PopupDialog {
id: referenceContextDialog
anchors.centerIn: parent
shouldTimeOut: false
shouldShowBusy: false
modal: true
}
Rectangle {
id: conversation
color: theme.backgroundLight
@@ -600,6 +608,7 @@ Window {
width: listView.width
color: theme.textColor
wrapMode: Text.WordWrap
textFormat: TextEdit.MarkdownText
focus: false
readOnly: true
font.pixelSize: theme.fontSizeLarge
@@ -621,6 +630,17 @@ Window {
leftPadding: 100
rightPadding: 100
onLinkActivated: function (link) {
if (!link.startsWith("context://"))
return;
console.log("link " + link);
var integer = parseInt(link.split("://")[1]);
console.log("context is" + referencesContext[integer - 1]);
referenceContextDialog.text = referencesContext[integer - 1];
referenceContextDialog.open();
}
Item {
anchors.left: parent.left
anchors.leftMargin: 90