mirror of
https://github.com/nomic-ai/gpt4all
synced 2024-11-08 07:10:32 +00:00
Add context menus to the prompt and the responses
Signed-off-by: Kryotek <gcda@outlook.it>
This commit is contained in:
parent
11db71e0a7
commit
afbb30a523
@ -1057,6 +1057,32 @@ Window {
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: conversationMouseArea
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
|
||||
onClicked: {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
conversationContextMenu.x = conversationMouseArea.mouseX
|
||||
conversationContextMenu.y = conversationMouseArea.mouseY
|
||||
conversationContextMenu.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Menu {
|
||||
id: conversationContextMenu
|
||||
MenuItem {
|
||||
text: "Copy"
|
||||
onTriggered: myTextArea.copy()
|
||||
}
|
||||
MenuItem {
|
||||
text: "Select All"
|
||||
onTriggered: myTextArea.selectAll()
|
||||
}
|
||||
}
|
||||
|
||||
ResponseText {
|
||||
id: responseText
|
||||
}
|
||||
@ -1399,6 +1425,41 @@ Window {
|
||||
MySettings.repeatPenaltyTokens)
|
||||
textInput.text = ""
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: textInputMouseArea
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
|
||||
onClicked: {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
textInputContextMenu.x = textInputMouseArea.mouseX
|
||||
textInputContextMenu.y = textInputMouseArea.mouseY
|
||||
textInputContextMenu.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Menu {
|
||||
id: textInputContextMenu
|
||||
MenuItem {
|
||||
text: "Cut"
|
||||
onTriggered: textInput.cut()
|
||||
}
|
||||
MenuItem {
|
||||
text: "Copy"
|
||||
onTriggered: textInput.copy()
|
||||
}
|
||||
MenuItem {
|
||||
text: "Paste"
|
||||
onTriggered: textInput.paste()
|
||||
}
|
||||
MenuItem {
|
||||
text: "Select All"
|
||||
onTriggered: textInput.selectAll()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user