From a328f9ed3fdf238835429dd45940850724d0a652 Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Wed, 22 Nov 2023 09:10:44 -0500 Subject: [PATCH] Add a button to the collections dialog. Fix close button. --- gpt4all-chat/main.qml | 4 ++++ gpt4all-chat/qml/CollectionsDialog.qml | 15 ++++++++++++++- gpt4all-chat/qml/MyDialog.qml | 9 +++++++++ gpt4all-chat/qml/SettingsDialog.qml | 1 + 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/gpt4all-chat/main.qml b/gpt4all-chat/main.qml index fa3e8430..18b346a9 100644 --- a/gpt4all-chat/main.qml +++ b/gpt4all-chat/main.qml @@ -431,6 +431,10 @@ Window { CollectionsDialog { id: collectionsDialog anchors.centerIn: parent + onAddRemoveClicked: { + settingsDialog.pageToDisplay = 2; + settingsDialog.open(); + } } MyToolButton { diff --git a/gpt4all-chat/qml/CollectionsDialog.qml b/gpt4all-chat/qml/CollectionsDialog.qml index f5a8b538..b763e688 100644 --- a/gpt4all-chat/qml/CollectionsDialog.qml +++ b/gpt4all-chat/qml/CollectionsDialog.qml @@ -15,6 +15,7 @@ MyDialog { width: 480 height: 640 + signal addRemoveClicked property var currentChat: ChatListModel.currentChat Label { @@ -30,7 +31,8 @@ MyDialog { id: scrollView anchors.top: listLabel.bottom anchors.topMargin: 20 - anchors.bottom: parent.bottom + anchors.bottom: collectionSettings.top + anchors.bottomMargin: 20 anchors.left: parent.left anchors.right: parent.right clip: true @@ -120,4 +122,15 @@ MyDialog { } } } + + MyButton { + id: collectionSettings + anchors.bottom: parent.bottom + anchors.horizontalCenter: parent.horizontalCenter + text: qsTr("Add & Remove") + font.pixelSize: theme.fontSizeLarger + onClicked: { + addRemoveClicked() + } + } } diff --git a/gpt4all-chat/qml/MyDialog.qml b/gpt4all-chat/qml/MyDialog.qml index 6923a706..480848fd 100644 --- a/gpt4all-chat/qml/MyDialog.qml +++ b/gpt4all-chat/qml/MyDialog.qml @@ -17,6 +17,15 @@ Dialog { radius: 10 } + Rectangle { + id: closeBackground + z: 299 + anchors.centerIn: myCloseButton + width: myCloseButton.width + 10 + height: myCloseButton.height + 10 + color: theme.backgroundDarkest + } + MyToolButton { id: myCloseButton x: 0 + myDialog.width - myDialog.padding - width - 15 diff --git a/gpt4all-chat/qml/SettingsDialog.qml b/gpt4all-chat/qml/SettingsDialog.qml index dd68d3c8..d8120753 100644 --- a/gpt4all-chat/qml/SettingsDialog.qml +++ b/gpt4all-chat/qml/SettingsDialog.qml @@ -20,6 +20,7 @@ MyDialog { } signal downloadClicked + property alias pageToDisplay: listView.currentIndex Item { Accessible.role: Accessible.Dialog