From 71ff6bc6f4f84de81aa9ebc761118086adbef82a Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Sun, 16 Apr 2023 11:44:55 -0400 Subject: [PATCH] Rearrange the buttons and provide a message what the copy button does. --- main.qml | 85 +++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 57 insertions(+), 28 deletions(-) diff --git a/main.qml b/main.qml index 0f3f97de..8975fa0e 100644 --- a/main.qml +++ b/main.qml @@ -311,7 +311,7 @@ Window { } Button { - id: copyButton + id: settingsButton anchors.right: parent.right anchors.top: parent.top anchors.topMargin: 30 @@ -321,6 +321,55 @@ Window { z: 200 padding: 15 + background: Item { + anchors.fill: parent + Image { + anchors.centerIn: parent + width: 40 + height: 40 + source: "qrc:/gpt4all-chat/icons/settings.svg" + } + } + + onClicked: { + settingsDialog.open() + } + } + + Dialog { + id: copyMessage + anchors.centerIn: parent + modal: false + opacity: 0.9 + Text { + horizontalAlignment: Text.AlignJustify + text: qsTr("Conversation copied to clipboard.") + color: "#d1d5db" + } + background: Rectangle { + anchors.fill: parent + color: "#202123" + border.width: 1 + border.color: "white" + radius: 10 + } + + exit: Transition { + NumberAnimation { duration: 500; property: "opacity"; from: 1.0; to: 0.0 } + } + } + + Button { + id: copyButton + anchors.right: settingsButton.left + anchors.top: parent.top + anchors.topMargin: 30 + anchors.rightMargin: 30 + width: 60 + height: 40 + z: 200 + padding: 15 + background: Item { anchors.fill: parent Image { @@ -351,6 +400,13 @@ Window { copyEdit.text = conversation copyEdit.selectAll() copyEdit.copy() + copyMessage.open() + timer.start() + } + Timer { + id: timer + interval: 500; running: false; repeat: false + onTriggered: copyMessage.close() } } @@ -382,33 +438,6 @@ Window { } } - Button { - id: settingsButton - anchors.right: resetContextButton.left - anchors.top: parent.top - - anchors.topMargin: 30 - anchors.rightMargin: 30 - width: 60 - height: 40 - z: 200 - padding: 15 - - background: Item { - anchors.fill: parent - Image { - anchors.centerIn: parent - width: 40 - height: 40 - source: "qrc:/gpt4all-chat/icons/settings.svg" - } - } - - onClicked: { - settingsDialog.open() - } - } - Dialog { id: checkForUpdatesError anchors.centerIn: parent