mirror of
https://github.com/nomic-ai/gpt4all
synced 2024-11-02 09:40:42 +00:00
Add multi-line prompt support.
This commit is contained in:
parent
4c970fdc9c
commit
cd5f525950
29
main.qml
29
main.qml
@ -755,7 +755,7 @@ Window {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: textInput.top
|
||||
anchors.bottom: textInputView.top
|
||||
anchors.bottomMargin: 30
|
||||
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
|
||||
|
||||
@ -886,8 +886,8 @@ Window {
|
||||
}
|
||||
}
|
||||
}
|
||||
anchors.bottom: textInput.top
|
||||
anchors.horizontalCenter: textInput.horizontalCenter
|
||||
anchors.bottom: textInputView.top
|
||||
anchors.horizontalCenter: textInputView.horizontalCenter
|
||||
anchors.bottomMargin: 40
|
||||
padding: 15
|
||||
contentItem: Text {
|
||||
@ -906,12 +906,16 @@ Window {
|
||||
}
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: textInput
|
||||
ScrollView {
|
||||
id: textInputView
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.margins: 30
|
||||
height: Math.min(contentHeight, 200)
|
||||
|
||||
TextArea {
|
||||
id: textInput
|
||||
color: "#dadadc"
|
||||
padding: 20
|
||||
enabled: LLM.isModelLoaded
|
||||
@ -925,7 +929,13 @@ Window {
|
||||
Accessible.role: Accessible.EditableText
|
||||
Accessible.name: placeholderText
|
||||
Accessible.description: qsTr("Textfield for sending messages/prompts to the model")
|
||||
onAccepted: {
|
||||
Keys.onReturnPressed: {
|
||||
if (event.modifiers & Qt.ControlModifier || event.modifiers & Qt.ShiftModifier)
|
||||
event.accepted = false;
|
||||
else
|
||||
editingFinished();
|
||||
}
|
||||
onEditingFinished: {
|
||||
if (textInput.text === "")
|
||||
return
|
||||
|
||||
@ -945,10 +955,12 @@ Window {
|
||||
settingsDialog.topP, settingsDialog.temperature, settingsDialog.promptBatchSize)
|
||||
textInput.text = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
anchors.right: textInput.right
|
||||
anchors.verticalCenter: textInput.verticalCenter
|
||||
anchors.right: textInputView.right
|
||||
anchors.verticalCenter: textInputView.verticalCenter
|
||||
anchors.rightMargin: 15
|
||||
width: 30
|
||||
height: 30
|
||||
@ -967,5 +979,4 @@ Window {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user