From 7b0d3c2abb09913251af28ea4dbb5431a3002bb7 Mon Sep 17 00:00:00 2001 From: Petr Mironychev <9195189+Palm1r@users.noreply.github.com> Date: Mon, 1 Dec 2025 13:39:26 +0100 Subject: [PATCH] feat: Add settings shortcut to chat view --- ChatView/CMakeLists.txt | 1 + ChatView/ChatRootView.cpp | 6 ++++++ ChatView/ChatRootView.hpp | 1 + ChatView/icons/settings-icon.svg | 4 ++++ ChatView/qml/RootItem.qml | 1 + ChatView/qml/controls/TopBar.qml | 18 ++++++++++++++++++ 6 files changed, 31 insertions(+) create mode 100644 ChatView/icons/settings-icon.svg diff --git a/ChatView/CMakeLists.txt b/ChatView/CMakeLists.txt index 9c449fd..2cee930 100644 --- a/ChatView/CMakeLists.txt +++ b/ChatView/CMakeLists.txt @@ -51,6 +51,7 @@ qt_add_qml_module(QodeAssistChatView icons/thinking-icon-off.svg icons/tools-icon-on.svg icons/tools-icon-off.svg + icons/settings-icon.svg SOURCES ChatWidget.hpp ChatWidget.cpp diff --git a/ChatView/ChatRootView.cpp b/ChatView/ChatRootView.cpp index b182291..e62ea86 100644 --- a/ChatView/ChatRootView.cpp +++ b/ChatView/ChatRootView.cpp @@ -38,6 +38,7 @@ #include "ChatSerializer.hpp" #include "ConfigurationManager.hpp" #include "GeneralSettings.hpp" +#include "SettingsConstants.hpp" #include "Logger.hpp" #include "ProjectSettings.hpp" #include "ProvidersManager.hpp" @@ -696,6 +697,11 @@ void ChatRootView::openRulesFolder() QDesktopServices::openUrl(url); } +void ChatRootView::openSettings() +{ + Core::ICore::showOptionsDialog(Constants::QODE_ASSIST_CHAT_ASSISTANT_SETTINGS_PAGE_ID); +} + void ChatRootView::updateInputTokensCount() { int inputTokens = m_messageTokensCount; diff --git a/ChatView/ChatRootView.hpp b/ChatView/ChatRootView.hpp index c7eb69f..c7d9ef9 100644 --- a/ChatView/ChatRootView.hpp +++ b/ChatView/ChatRootView.hpp @@ -94,6 +94,7 @@ public: Q_INVOKABLE void setIsSyncOpenFiles(bool state); Q_INVOKABLE void openChatHistoryFolder(); Q_INVOKABLE void openRulesFolder(); + Q_INVOKABLE void openSettings(); Q_INVOKABLE void updateInputTokensCount(); int inputTokensCount() const; diff --git a/ChatView/icons/settings-icon.svg b/ChatView/icons/settings-icon.svg new file mode 100644 index 0000000..fd33117 --- /dev/null +++ b/ChatView/icons/settings-icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/ChatView/qml/RootItem.qml b/ChatView/qml/RootItem.qml index 08d8049..c70b549 100644 --- a/ChatView/qml/RootItem.qml +++ b/ChatView/qml/RootItem.qml @@ -117,6 +117,7 @@ ChatRootView { root.useThinking = thinkingMode.checked } } + settingsButton.onClicked: root.openSettings() configSelector { model: root.availableConfigurations displayText: root.currentConfiguration diff --git a/ChatView/qml/controls/TopBar.qml b/ChatView/qml/controls/TopBar.qml index b83268c..9d6b458 100644 --- a/ChatView/qml/controls/TopBar.qml +++ b/ChatView/qml/controls/TopBar.qml @@ -36,6 +36,7 @@ Rectangle { property alias rulesButton: rulesButtonId property alias toolsButton: toolsButtonId property alias thinkingMode: thinkingModeId + property alias settingsButton: settingsButtonId property alias activeRulesCount: activeRulesCountId.text property alias configSelector: configSelectorId @@ -139,6 +140,23 @@ Rectangle { : qsTr("Thinking Mode disabled")) : qsTr("Thinking Mode is not available for this provider") } + + QoAButton { + id: settingsButtonId + + anchors.verticalCenter: parent.verticalCenter + + icon { + source: "qrc:/qt/qml/ChatView/icons/settings-icon.svg" + color: palette.window.hslLightness > 0.5 ? "#000000" : "#FFFFFF" + height: 15 + width: 15 + } + + ToolTip.visible: hovered + ToolTip.delay: 250 + ToolTip.text: qsTr("Open Chat Assistant Settings") + } } Item {