mirror of
https://github.com/nomic-ai/gpt4all
synced 2024-11-10 01:10:35 +00:00
Go ahead and try to handle links in the text by opening them externally. (#2479)
Handle links in the text by opening them externally. Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
parent
81bbeef5b3
commit
426aa5eb47
@ -844,6 +844,16 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
onLinkActivated: function(link) {
|
||||
if (!currentResponse || !currentChat.responseInProgress)
|
||||
Qt.openUrlExternally(link)
|
||||
}
|
||||
|
||||
onLinkHovered: function (link) {
|
||||
if (!currentResponse || !currentChat.responseInProgress)
|
||||
statusBar.hoveredLink = link
|
||||
}
|
||||
|
||||
Menu {
|
||||
id: conversationContextMenu
|
||||
MenuItem {
|
||||
@ -1320,7 +1330,8 @@ Rectangle {
|
||||
}
|
||||
|
||||
Text {
|
||||
id: device
|
||||
id: statusBar
|
||||
property string hoveredLink: ""
|
||||
anchors.top: textInputView.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
@ -1330,10 +1341,13 @@ Rectangle {
|
||||
horizontalAlignment: Qt.AlignRight
|
||||
verticalAlignment: Qt.AlignVCenter
|
||||
color: theme.mutedTextColor
|
||||
visible: currentChat.tokenSpeed !== ""
|
||||
visible: currentChat.tokenSpeed !== "" || hoveredLink !== ""
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.WordWrap
|
||||
text: {
|
||||
if (hoveredLink !== "")
|
||||
return hoveredLink
|
||||
|
||||
const segments = [currentChat.tokenSpeed];
|
||||
const device = currentChat.device;
|
||||
const backend = currentChat.deviceBackend;
|
||||
|
Loading…
Reference in New Issue
Block a user