mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2024-09-11 21:27:37 +03: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 {
|
Menu {
|
||||||
id: conversationContextMenu
|
id: conversationContextMenu
|
||||||
MenuItem {
|
MenuItem {
|
||||||
@ -1320,7 +1330,8 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: device
|
id: statusBar
|
||||||
|
property string hoveredLink: ""
|
||||||
anchors.top: textInputView.bottom
|
anchors.top: textInputView.bottom
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
@ -1330,10 +1341,13 @@ Rectangle {
|
|||||||
horizontalAlignment: Qt.AlignRight
|
horizontalAlignment: Qt.AlignRight
|
||||||
verticalAlignment: Qt.AlignVCenter
|
verticalAlignment: Qt.AlignVCenter
|
||||||
color: theme.mutedTextColor
|
color: theme.mutedTextColor
|
||||||
visible: currentChat.tokenSpeed !== ""
|
visible: currentChat.tokenSpeed !== "" || hoveredLink !== ""
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
text: {
|
text: {
|
||||||
|
if (hoveredLink !== "")
|
||||||
|
return hoveredLink
|
||||||
|
|
||||||
const segments = [currentChat.tokenSpeed];
|
const segments = [currentChat.tokenSpeed];
|
||||||
const device = currentChat.device;
|
const device = currentChat.device;
|
||||||
const backend = currentChat.deviceBackend;
|
const backend = currentChat.deviceBackend;
|
||||||
|
Loading…
Reference in New Issue
Block a user