From 39f41e49cea401bab95527b2c4b6247187b2042e Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 31 Mar 2025 17:05:23 +0800 Subject: [PATCH] Improve string resources --- .../UserSettings/Settings.cs | 2 +- Flow.Launcher.Plugin/SearchDelayTime.cs | 24 +++++++++---------- Flow.Launcher/Languages/en.xaml | 8 +++---- Flow.Launcher/SearchDelayTimeWindow.xaml.cs | 2 +- .../SettingsPaneGeneralViewModel.cs | 2 +- Flow.Launcher/ViewModel/MainViewModel.cs | 10 ++++---- .../plugin.json | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index fcfbe8ca0..6cb20d12f 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -323,7 +323,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings public bool SearchQueryResultsWithDelay { get; set; } [JsonConverter(typeof(JsonStringEnumConverter))] - public SearchDelayTime SearchDelayTime { get; set; } = SearchDelayTime.Medium; + public SearchDelayTime SearchDelayTime { get; set; } = SearchDelayTime.Normal; [JsonConverter(typeof(JsonStringEnumConverter))] public SearchWindowScreens SearchWindowScreen { get; set; } = SearchWindowScreens.Cursor; diff --git a/Flow.Launcher.Plugin/SearchDelayTime.cs b/Flow.Launcher.Plugin/SearchDelayTime.cs index 8dae5997e..ae1daabe0 100644 --- a/Flow.Launcher.Plugin/SearchDelayTime.cs +++ b/Flow.Launcher.Plugin/SearchDelayTime.cs @@ -6,27 +6,27 @@ public enum SearchDelayTime { /// - /// Long search delay time. 250ms. + /// Very long search delay time. 250ms. + /// + VeryLong, + + /// + /// Long search delay time. 200ms. /// Long, /// - /// Moderately long search delay time. 200ms. + /// Normal search delay time. 150ms. Default value. /// - ModeratelyLong, + Normal, /// - /// Medium search delay time. 150ms. Default value. + /// Short search delay time. 100ms. /// - Medium, + Short, /// - /// Moderately short search delay time. 100ms. + /// Very short search delay time. 50ms. /// - ModeratelyShort, - - /// - /// Short search delay time. 50ms. - /// - Short + VeryShort } diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index e6a764d48..364be4009 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -105,12 +105,12 @@ Search Delay Delay for a while to search when typing. This reduces interface jumpiness and result load. Default Search Delay Time - Plugin default delay time after which search results appear when typing is stopped. Default is "Medium". + Plugin default delay time after which search results appear when typing is stopped. + Very long Long - Moderately long - Medium - Moderately short + Normal Short + Very short Search Plugin diff --git a/Flow.Launcher/SearchDelayTimeWindow.xaml.cs b/Flow.Launcher/SearchDelayTimeWindow.xaml.cs index cfd8c5b7e..4a3c9f5a7 100644 --- a/Flow.Launcher/SearchDelayTimeWindow.xaml.cs +++ b/Flow.Launcher/SearchDelayTimeWindow.xaml.cs @@ -24,7 +24,7 @@ public partial class SearchDelayTimeWindow : Window tbOldSearchDelayTime.Text = _pluginViewModel.SearchDelayTimeText; var searchDelayTimes = DropdownDataGeneric.GetValues("SearchDelayTime"); SearchDelayTimeData selected = null; - // Because default value is SearchDelayTime.Slow, we need to get selected value before adding default value + // Because default value is SearchDelayTime.VeryShort, we need to get selected value before adding default value if (_pluginViewModel.PluginSearchDelayTime != null) { selected = searchDelayTimes.FirstOrDefault(x => x.Value == _pluginViewModel.PluginSearchDelayTime); diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs index 3262ad208..cec8c318c 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs @@ -150,7 +150,7 @@ public partial class SettingsPaneGeneralViewModel : BaseModel public SearchDelayTimeData SearchDelayTime { get => SearchDelayTimes.FirstOrDefault(x => x.Value == Settings.SearchDelayTime) ?? - SearchDelayTimes.FirstOrDefault(x => x.Value == Plugin.SearchDelayTime.Medium) ?? + SearchDelayTimes.FirstOrDefault(x => x.Value == Plugin.SearchDelayTime.Normal) ?? SearchDelayTimes.FirstOrDefault(); set { diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 283e26b95..2fc4eaf7c 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -1273,11 +1273,11 @@ namespace Flow.Launcher.ViewModel { var searchDelayTime = (plugin.Metadata.SearchDelayTime ?? Settings.SearchDelayTime) switch { - SearchDelayTime.Long => 250, - SearchDelayTime.ModeratelyLong => 200, - SearchDelayTime.Medium => 150, - SearchDelayTime.ModeratelyShort => 100, - SearchDelayTime.Short => 50, + SearchDelayTime.VeryLong => 250, + SearchDelayTime.Long => 200, + SearchDelayTime.Normal => 150, + SearchDelayTime.Short => 100, + SearchDelayTime.VeryShort => 50, _ => 150 }; diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json b/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json index e27426133..64681f803 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json @@ -32,5 +32,5 @@ "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.WebSearch.dll", "IcoPath": "Images\\web_search.png", - "SearchDelayTime": "Long" + "SearchDelayTime": "VeryLong" }