mirror of https://github.com/nomic-ai/gpt4all
Add more of the UI for selecting collections for chats.
parent
2827c5876c
commit
01b8c7617f
@ -0,0 +1,5 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="#7d7d8e" viewBox="0 0 448 512"><path d="M448 80v48c0 44.2-100.3 80-224 80S0 172.2 0 128V80C0 35.8 100.3 0 224 0S448 35.8 448 80zM393.2 214.7c20.8-7.4 39.9-16.9 54.8-28.6V288c0 44.2-100.3 80-224 80S0 332.2 0 288V186.1c14.9 11.8 34 21.2 54.8 28.6C99.7 230.7 159.5 240 224 240s124.3-9.3 169.2-25.3zM0 346.1c14.9 11.8 34 21.2 54.8 28.6C99.7 390.7 159.5 400 224 400s124.3-9.3 169.2-25.3c20.8-7.4 39.9-16.9 54.8-28.6V432c0 44.2-100.3 80-224 80S0 476.2 0 432V346.1z"/></svg>
|
||||||
|
<!--
|
||||||
|
Font Awesome Free 5.2.0 by @fontawesome - https://fontawesome.com
|
||||||
|
License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||||
|
-->
|
After Width: | Height: | Size: 689 B |
@ -0,0 +1,86 @@
|
|||||||
|
import QtCore
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Controls.Basic
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Dialogs
|
||||||
|
import localdocs
|
||||||
|
import llm
|
||||||
|
|
||||||
|
Dialog {
|
||||||
|
id: collectionsDialog
|
||||||
|
modal: true
|
||||||
|
opacity: 0.9
|
||||||
|
padding: 20
|
||||||
|
width: 480
|
||||||
|
height: 640
|
||||||
|
|
||||||
|
property var currentChat: LLM.chatListModel.currentChat
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
color: theme.backgroundDarkest
|
||||||
|
border.width: 1
|
||||||
|
border.color: theme.dialogBorder
|
||||||
|
radius: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
id: listLabel
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
text: "Available Collections:"
|
||||||
|
color: theme.textColor
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollView {
|
||||||
|
id: scrollView
|
||||||
|
anchors.top: listLabel.bottom
|
||||||
|
anchors.topMargin: 20
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
clip: true
|
||||||
|
contentHeight: 300
|
||||||
|
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
color: theme.backgroundLighter
|
||||||
|
}
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
id: listView
|
||||||
|
model: LocalDocs.localDocsModel
|
||||||
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
|
delegate: Rectangle {
|
||||||
|
id: item
|
||||||
|
width: listView.width
|
||||||
|
height: collectionId.height + 40
|
||||||
|
color: index % 2 === 0 ? theme.backgroundLight : theme.backgroundLighter
|
||||||
|
MyCheckBox {
|
||||||
|
id: checkBox
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.margins: 20
|
||||||
|
checked: currentChat.hasCollection(collection)
|
||||||
|
onClicked: {
|
||||||
|
if (checkBox.checked) {
|
||||||
|
currentChat.addCollection(collection)
|
||||||
|
} else {
|
||||||
|
currentChat.removeCollection(collection)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
id: collectionId
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.left: checkBox.right
|
||||||
|
anchors.margins: 20
|
||||||
|
text: collection
|
||||||
|
elide: Text.ElideRight
|
||||||
|
color: theme.textColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue