mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-08-04 17:42:25 +00:00
ChatView: make context menus more intuitive (#2324)
* ChatView: fix deprecation warning Signed-off-by: Jared Van Bortel <jared@nomic.ai> * ChatView: make context menus more intuitive Signed-off-by: Jared Van Bortel <jared@nomic.ai> --------- Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
parent
cef74c2be2
commit
d54e644d05
@ -1069,7 +1069,7 @@ Rectangle {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.RightButton
|
acceptedButtons: Qt.RightButton
|
||||||
|
|
||||||
onClicked: {
|
onClicked: (mouse) => {
|
||||||
if (mouse.button === Qt.RightButton) {
|
if (mouse.button === Qt.RightButton) {
|
||||||
conversationContextMenu.x = conversationMouseArea.mouseX
|
conversationContextMenu.x = conversationMouseArea.mouseX
|
||||||
conversationContextMenu.y = conversationMouseArea.mouseY
|
conversationContextMenu.y = conversationMouseArea.mouseY
|
||||||
@ -1082,11 +1082,19 @@ Rectangle {
|
|||||||
id: conversationContextMenu
|
id: conversationContextMenu
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: qsTr("Copy")
|
text: qsTr("Copy")
|
||||||
|
enabled: myTextArea.selectedText !== ""
|
||||||
|
height: enabled ? implicitHeight : 0
|
||||||
onTriggered: myTextArea.copy()
|
onTriggered: myTextArea.copy()
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: qsTr("Select All")
|
text: qsTr("Copy Message")
|
||||||
onTriggered: myTextArea.selectAll()
|
enabled: myTextArea.selectedText === ""
|
||||||
|
height: enabled ? implicitHeight : 0
|
||||||
|
onTriggered: {
|
||||||
|
myTextArea.selectAll()
|
||||||
|
myTextArea.copy()
|
||||||
|
myTextArea.deselect()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1441,7 +1449,7 @@ Rectangle {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.RightButton
|
acceptedButtons: Qt.RightButton
|
||||||
|
|
||||||
onClicked: {
|
onClicked: (mouse) => {
|
||||||
if (mouse.button === Qt.RightButton) {
|
if (mouse.button === Qt.RightButton) {
|
||||||
textInputContextMenu.x = textInputMouseArea.mouseX
|
textInputContextMenu.x = textInputMouseArea.mouseX
|
||||||
textInputContextMenu.y = textInputMouseArea.mouseY
|
textInputContextMenu.y = textInputMouseArea.mouseY
|
||||||
@ -1454,10 +1462,14 @@ Rectangle {
|
|||||||
id: textInputContextMenu
|
id: textInputContextMenu
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: qsTr("Cut")
|
text: qsTr("Cut")
|
||||||
|
enabled: textInput.selectedText !== ""
|
||||||
|
height: enabled ? implicitHeight : 0
|
||||||
onTriggered: textInput.cut()
|
onTriggered: textInput.cut()
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: qsTr("Copy")
|
text: qsTr("Copy")
|
||||||
|
enabled: textInput.selectedText !== ""
|
||||||
|
height: enabled ? implicitHeight : 0
|
||||||
onTriggered: textInput.copy()
|
onTriggered: textInput.copy()
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
|
Loading…
Reference in New Issue
Block a user