From 539a220771b4cb26a6b8fe3449dc6c99f80f0b8c Mon Sep 17 00:00:00 2001 From: Petr Mironychev <9195189+Palm1r@users.noreply.github.com> Date: Sun, 8 Sep 2024 14:31:52 +0200 Subject: [PATCH] Fix settings layouts --- QodeAssist.json.in | 2 +- settings/ContextSettings.cpp | 4 ++-- settings/GeneralSettings.cpp | 19 +++++++++---------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/QodeAssist.json.in b/QodeAssist.json.in index d8b1f23..8e11076 100644 --- a/QodeAssist.json.in +++ b/QodeAssist.json.in @@ -1,6 +1,6 @@ { "Name" : "QodeAssist", - "Version" : "0.1.0", + "Version" : "0.1.1", "CompatVersion" : "${IDE_VERSION_COMPAT}", "Vendor" : "Petr Mironychev", "Copyright" : "(C) ${IDE_COPYRIGHT_YEAR} Petr Mironychev, (C) ${IDE_COPYRIGHT_YEAR} The Qt Company Ltd", diff --git a/settings/ContextSettings.cpp b/settings/ContextSettings.cpp index f9af061..d0574df 100644 --- a/settings/ContextSettings.cpp +++ b/settings/ContextSettings.cpp @@ -85,8 +85,8 @@ ContextSettings::ContextSettings() setLayouter([this]() { using namespace Layouting; return Column{Row{readFullFile, Stretch{1}, resetToDefaults}, - readStringsBeforeCursor, - readStringsAfterCursor, + Row{readStringsBeforeCursor, Stretch{1}}, + Row{readStringsAfterCursor, Stretch{1}}, useFilePathInContext, useSpecificInstructions, specificInstractions, diff --git a/settings/GeneralSettings.cpp b/settings/GeneralSettings.cpp index 0edb0b0..5f86830 100644 --- a/settings/GeneralSettings.cpp +++ b/settings/GeneralSettings.cpp @@ -62,22 +62,20 @@ GeneralSettings::GeneralSettings() multiLineCompletion.setLabelText(Tr::tr("Enable Multiline Completion")); startSuggestionTimer.setSettingsKey(Constants::START_SUGGESTION_TIMER); - startSuggestionTimer.setLabelText(Tr::tr("Start Suggestion Timer:")); + startSuggestionTimer.setLabelText(Tr::tr("with delay(ms)")); startSuggestionTimer.setRange(10, 10000); startSuggestionTimer.setDefaultValue(500); autoCompletionCharThreshold.setSettingsKey(Constants::AUTO_COMPLETION_CHAR_THRESHOLD); - autoCompletionCharThreshold.setLabelText( - Tr::tr("Character threshold for AI suggestion start:")); + autoCompletionCharThreshold.setLabelText(Tr::tr("AI suggestion triggers after typing")); autoCompletionCharThreshold.setToolTip( Tr::tr("The number of characters that need to be typed within the typing interval " "before an AI suggestion request is sent.")); - autoCompletionCharThreshold.setRange(1, 10); - autoCompletionCharThreshold.setDefaultValue(2); + autoCompletionCharThreshold.setRange(0, 10); + autoCompletionCharThreshold.setDefaultValue(1); autoCompletionTypingInterval.setSettingsKey(Constants::AUTO_COMPLETION_TYPING_INTERVAL); - autoCompletionTypingInterval.setLabelText( - Tr::tr("Typing interval for AI suggestion start(ms):")); + autoCompletionTypingInterval.setLabelText(Tr::tr("character(s) within(ms)")); autoCompletionTypingInterval.setToolTip( Tr::tr("The time window (in milliseconds) during which the character threshold " "must be met to trigger an AI suggestion request.")); @@ -138,10 +136,11 @@ GeneralSettings::GeneralSettings() auto rootLayout = Column{Row{enableQodeAssist, Stretch{1}, resetToDefaults}, enableAutoComplete, - startSuggestionTimer, - autoCompletionCharThreshold, - autoCompletionTypingInterval, multiLineCompletion, + Row{autoCompletionCharThreshold, + autoCompletionTypingInterval, + startSuggestionTimer, + Stretch{1}}, Space{8}, enableLogging, Space{8},