From e955e47e5fafcf54b6aa651dcc04db7ed9355523 Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 7 Apr 2025 22:47:39 +0900 Subject: [PATCH] - Change combobox to numberbox - Adjust Numberbox Style - Add small change value(10) - Adjust strings --- .../UserSettings/Settings.cs | 4 --- Flow.Launcher/Languages/en.xaml | 10 ++---- .../Controls/InstalledPluginDisplay.xaml | 7 ++-- .../Resources/CustomControlTemplate.xaml | 28 ++++++++++----- .../SettingsPaneGeneralViewModel.cs | 35 +++++-------------- .../SettingsPanePluginsViewModel.cs | 4 +-- .../Views/SettingsPaneGeneral.xaml | 17 +++++---- 7 files changed, 49 insertions(+), 56 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index d89340e19..e304a1b50 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -321,10 +321,6 @@ namespace Flow.Launcher.Infrastructure.UserSettings public bool HideWhenDeactivated { get; set; } = true; public bool SearchQueryResultsWithDelay { get; set; } - - [JsonIgnore] - public IEnumerable SearchDelayTimeRange = new List { 50, 100, 150, 200, 250, 300, 350, 400, 450, 500 }; - public int SearchDelayTime { get; set; } = 150; [JsonConverter(typeof(JsonStringEnumConverter))] diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 5d9b16e0b..f01d0575a 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -108,14 +108,10 @@ Always open preview panel when Flow activates. Press {0} to toggle preview. Shadow effect is not allowed while current theme has blur effect enabled Search Delay - Delay for a while to search when typing. This reduces interface jumpiness and result load. + Adds a short delay while typing to reduce UI flicker and result load. Recommended if your typing speed is average. Default Search Delay Time - Plugin default delay time after which search results appear when typing is stopped. - Very long - Long - Normal - Short - Very short + Wait time before showing results after typing stops. Higher values wait longer. (ms) + Default Search Plugin diff --git a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml index ece66034c..9a4e3b7b0 100644 --- a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml +++ b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml @@ -88,12 +88,15 @@ Text="{DynamicResource searchDelay}" ToolTip="{DynamicResource searchDelayToolTip}" /> + Value="{Binding PluginSearchDelayTime, Mode=TwoWay}"> + diff --git a/Flow.Launcher/Resources/CustomControlTemplate.xaml b/Flow.Launcher/Resources/CustomControlTemplate.xaml index b51e5fec0..157910b4a 100644 --- a/Flow.Launcher/Resources/CustomControlTemplate.xaml +++ b/Flow.Launcher/Resources/CustomControlTemplate.xaml @@ -1503,7 +1503,7 @@ - + @@ -2689,10 +2689,20 @@ MinWidth="{TemplateBinding MinWidth}" MinHeight="{TemplateBinding MinHeight}" ui:ValidationHelper.IsTemplateValidationAdornerSite="True" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}" /> + Background="{DynamicResource CustomTextBoxBG}" + BorderBrush="{DynamicResource CustomTextBoxOutline}" + BorderThickness="{DynamicResource CustomTextBoxOutlineThickness}" + CornerRadius="4"> + + - + @@ -2788,8 +2798,10 @@ - - + + + + diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs index 74e2d8340..35dbab647 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs @@ -32,25 +32,7 @@ public partial class SettingsPaneGeneralViewModel : BaseModel public class SearchWindowAlignData : DropdownDataGeneric { } public class SearchPrecisionData : DropdownDataGeneric { } public class LastQueryModeData : DropdownDataGeneric { } - public class SearchDelayTimeData - { - public string Display { get; set; } - public int Value { get; set; } - - public static List GetValues() - { - var settings = Ioc.Default.GetRequiredService(); - var data = new List(); - - foreach (var value in settings.SearchDelayTimeRange) - { - var display = $"{value}ms"; - data.Add(new SearchDelayTimeData { Display = display, Value = value }); - } - - return data; - } - } + public bool StartFlowLauncherOnSystemStartup { @@ -163,21 +145,20 @@ public partial class SettingsPaneGeneralViewModel : BaseModel public List LastQueryModes { get; } = DropdownDataGeneric.GetValues("LastQuery"); - public List SearchDelayTimes { get; } = SearchDelayTimeData.GetValues(); - - public SearchDelayTimeData SearchDelayTime + public int SearchDelayTimeValue { - get => SearchDelayTimes.FirstOrDefault(x => x.Value == Settings.SearchDelayTime); + get => Settings.SearchDelayTime; set { - if (value == null) return; - - if (Settings.SearchDelayTime != value.Value) + if (Settings.SearchDelayTime != value) { - Settings.SearchDelayTime = value.Value; + Settings.SearchDelayTime = value; + OnPropertyChanged(); + OnPropertyChanged(nameof(SearchDelayTimeDisplay)); } } } + public string SearchDelayTimeDisplay => $"{SearchDelayTimeValue}ms"; private void UpdateEnumDropdownLocalizations() { diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs index 46e398eb5..4958bb7b7 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs @@ -122,7 +122,7 @@ public partial class SettingsPanePluginsViewModel : BaseModel { new TextBlock { - Text = (string)Application.Current.Resources["changePriorityWindow"], + Text = (string)Application.Current.Resources["priority"], FontSize = 18, Margin = new Thickness(0, 0, 0, 10), TextWrapping = TextWrapping.Wrap @@ -134,7 +134,7 @@ public partial class SettingsPanePluginsViewModel : BaseModel }, new TextBlock { - Text = (string)Application.Current.Resources["searchDelayTimeTitle"], + Text = (string)Application.Current.Resources["searchDelay"], FontSize = 18, Margin = new Thickness(0, 24, 0, 10), TextWrapping = TextWrapping.Wrap diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml index 10e2b549a..657e97f30 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml @@ -211,12 +211,17 @@ Title="{DynamicResource searchDelayTime}" Sub="{DynamicResource searchDelayTimeToolTip}" Type="InsideFit"> - + + +