From 1eacdf8d9d3617f4c832d39ed3c1d896b2508b55 Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 31 Mar 2025 21:19:49 +0900 Subject: [PATCH 01/27] Add Control in PluginDisplay --- .../Controls/InstalledPluginDisplay.xaml | 42 ++++++++++++++++--- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml index b19c668e0..74edd2dea 100644 --- a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml +++ b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml @@ -48,7 +48,7 @@ Grid.Column="2" HorizontalAlignment="Right" Orientation="Horizontal"> - - + --> + + - - + --> + + + + + + + + + + OnContent="{DynamicResource enable}" + Visibility="Collapsed" /> From 5fa244c806c430d35325ae30aa1dc22c5c6c4d40 Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 31 Mar 2025 22:44:34 +0900 Subject: [PATCH 02/27] Add setting filter --- .../Converters/StringEqualityToVisibilityConverter.cs | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Flow.Launcher/Converters/StringEqualityToVisibilityConverter.cs diff --git a/Flow.Launcher/Converters/StringEqualityToVisibilityConverter.cs b/Flow.Launcher/Converters/StringEqualityToVisibilityConverter.cs new file mode 100644 index 000000000..4757681bc --- /dev/null +++ b/Flow.Launcher/Converters/StringEqualityToVisibilityConverter.cs @@ -0,0 +1,6 @@ +namespace Flow.Launcher.Converters; + +public class StringEqualityToVisibilityConverter +{ + +} From 0136c570faf3d8cdf4e7094054a1ed0cd62103c5 Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 31 Mar 2025 22:44:46 +0900 Subject: [PATCH 03/27] Add Setting Filter --- .../StringEqualityToVisibilityConverter.cs | 23 ++++- .../Controls/InstalledPluginDisplay.xaml | 34 +++++-- .../SettingsPanePluginsViewModel.cs | 69 +++++++++++++++ .../Views/SettingsPanePlugins.xaml | 88 ++++++++++--------- Flow.Launcher/ViewModel/PluginViewModel.cs | 14 ++- 5 files changed, 172 insertions(+), 56 deletions(-) diff --git a/Flow.Launcher/Converters/StringEqualityToVisibilityConverter.cs b/Flow.Launcher/Converters/StringEqualityToVisibilityConverter.cs index 4757681bc..4e4453636 100644 --- a/Flow.Launcher/Converters/StringEqualityToVisibilityConverter.cs +++ b/Flow.Launcher/Converters/StringEqualityToVisibilityConverter.cs @@ -1,6 +1,23 @@ -namespace Flow.Launcher.Converters; +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; -public class StringEqualityToVisibilityConverter +namespace Flow.Launcher.Converters { - + public class StringEqualityToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value == null || parameter == null) + return Visibility.Collapsed; + + return value.ToString() == parameter.ToString() ? Visibility.Visible : Visibility.Collapsed; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } } diff --git a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml index 74edd2dea..ca9f673d8 100644 --- a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml +++ b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml @@ -7,10 +7,14 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:viewModel="clr-namespace:Flow.Launcher.ViewModel" + xmlns:converters="clr-namespace:Flow.Launcher.Converters" d:DataContext="{d:DesignInstance viewModel:PluginViewModel}" d:DesignHeight="300" d:DesignWidth="300" mc:Ignorable="d"> + + + + Visibility="{Binding DataContext.CurrentDisplayMode, + RelativeSource={RelativeSource AncestorType=ListBox}, + Converter={StaticResource StringEqualityToVisibilityConverter}, + ConverterParameter=Priority}"> + Margin="0 0 8 0" + VerticalAlignment="Center" + FontSize="13" + Foreground="{DynamicResource Color08B}" + Text="{DynamicResource priority}" /> + + Visibility="{Binding DataContext.CurrentDisplayMode, + RelativeSource={RelativeSource AncestorType=ListBox}, + Converter={StaticResource StringEqualityToVisibilityConverter}, + ConverterParameter=SearchDelay}"> + - + Visibility="{Binding DataContext.CurrentDisplayMode, + RelativeSource={RelativeSource AncestorType=ListBox}, + Converter={StaticResource StringEqualityToVisibilityConverter}, + ConverterParameter=OnOff}" /> + diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs index 3c1aba400..5cd14ba7e 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs @@ -14,6 +14,75 @@ public class SettingsPanePluginsViewModel : BaseModel { private readonly Settings _settings; + private bool _isOnOffSelected = true; + public bool IsOnOffSelected + { + get => _isOnOffSelected; + set + { + if (_isOnOffSelected != value) + { + _isOnOffSelected = value; + OnPropertyChanged(nameof(IsOnOffSelected)); + UpdateDisplayMode(); + } + } + } + + private bool _isPrioritySelected; + public bool IsPrioritySelected + { + get => _isPrioritySelected; + set + { + if (_isPrioritySelected != value) + { + _isPrioritySelected = value; + OnPropertyChanged(nameof(IsPrioritySelected)); + UpdateDisplayMode(); + } + } + } + + private bool _isSearchDelaySelected; + public bool IsSearchDelaySelected + { + get => _isSearchDelaySelected; + set + { + if (_isSearchDelaySelected != value) + { + _isSearchDelaySelected = value; + OnPropertyChanged(nameof(IsSearchDelaySelected)); + UpdateDisplayMode(); + } + } + } + + private string _currentDisplayMode = "OnOff"; + public string CurrentDisplayMode + { + get => _currentDisplayMode; + set + { + if (_currentDisplayMode != value) + { + _currentDisplayMode = value; + OnPropertyChanged(nameof(CurrentDisplayMode)); + } + } + } + + private void UpdateDisplayMode() + { + if (IsOnOffSelected) + CurrentDisplayMode = "OnOff"; + else if (IsPrioritySelected) + CurrentDisplayMode = "Priority"; + else if (IsSearchDelaySelected) + CurrentDisplayMode = "SearchDelay"; + } + public SettingsPanePluginsViewModel(Settings settings) { _settings = settings; diff --git a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml index 37079a46f..7580a5591 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml @@ -6,6 +6,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:ui="http://schemas.modernwpf.com/2019" + xmlns:converters="clr-namespace:Flow.Launcher.Converters" xmlns:viewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels" xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls" Title="Plugins" @@ -17,6 +18,7 @@ mc:Ignorable="d"> + @@ -31,51 +33,51 @@ Style="{StaticResource PageTitle}" Text="{DynamicResource plugins}" TextAlignment="Left" /> - - - - - + Orientation="Horizontal" + HorizontalAlignment="Right" + VerticalAlignment="Center"> + + + + + + + string.Join(Query.ActionKeywordSeparator, PluginPair.Metadata.ActionKeywords); - public int Priority => PluginPair.Metadata.Priority; + //public int Priority => PluginPair.Metadata.Priority; + private int _priority; + public int Priority + { + get => PluginPair.Metadata.Priority; + set + { + if (PluginPair.Metadata.Priority != value) + { + ChangePriority(value); + } + } + } public string SearchDelayTimeText => PluginPair.Metadata.SearchDelayTime == null ? App.API.GetTranslation("default") : App.API.GetTranslation($"SearchDelayTime{PluginPair.Metadata.SearchDelayTime}"); From fb50e6d08f6a31e4e43983867bfff3384acad300 Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 1 Apr 2025 05:03:49 +0900 Subject: [PATCH 04/27] Add search delay control --- Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml index ca9f673d8..009644fd6 100644 --- a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml +++ b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml @@ -120,9 +120,7 @@ RelativeSource={RelativeSource AncestorType=ListBox}, Converter={StaticResource StringEqualityToVisibilityConverter}, ConverterParameter=SearchDelay}"> - From d77400d39bbe1dbc7ae476326dfce66e3748f93f Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 1 Apr 2025 05:36:24 +0900 Subject: [PATCH 05/27] Add customcontrol for searchdelay --- .../Controls/InstalledPluginDisplay.xaml | 5 +- .../InstalledPluginSearchDelayCombobox.xaml | 39 +++++++++ ...InstalledPluginSearchDelayCombobox.xaml.cs | 84 +++++++++++++++++++ 3 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 Flow.Launcher/Resources/Controls/InstalledPluginSearchDelayCombobox.xaml create mode 100644 Flow.Launcher/Resources/Controls/InstalledPluginSearchDelayCombobox.xaml.cs diff --git a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml index 009644fd6..cb1d8dbc4 100644 --- a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml +++ b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml @@ -92,7 +92,7 @@ - - diff --git a/Flow.Launcher/Resources/Controls/InstalledPluginSearchDelayCombobox.xaml b/Flow.Launcher/Resources/Controls/InstalledPluginSearchDelayCombobox.xaml new file mode 100644 index 000000000..b379b875f --- /dev/null +++ b/Flow.Launcher/Resources/Controls/InstalledPluginSearchDelayCombobox.xaml @@ -0,0 +1,39 @@ + + + + + + + + \ No newline at end of file diff --git a/Flow.Launcher/Resources/Controls/InstalledPluginSearchDelayCombobox.xaml.cs b/Flow.Launcher/Resources/Controls/InstalledPluginSearchDelayCombobox.xaml.cs new file mode 100644 index 000000000..649913872 --- /dev/null +++ b/Flow.Launcher/Resources/Controls/InstalledPluginSearchDelayCombobox.xaml.cs @@ -0,0 +1,84 @@ +using System.Collections.Generic; +using System.Windows.Controls; +using Flow.Launcher.Plugin; + +namespace Flow.Launcher.Resources.Controls +{ + public partial class InstalledPluginSearchDelayCombobox + { + public InstalledPluginSearchDelayCombobox() + { + InitializeComponent(); + LoadDelayOptions(); + Loaded += InstalledPluginSearchDelayCombobox_Loaded; + } + + private void InstalledPluginSearchDelayCombobox_Loaded(object sender, System.Windows.RoutedEventArgs e) + { + if (DataContext is ViewModel.PluginViewModel viewModel) + { + // 초기 값 설정 + int currentDelayMs = GetCurrentDelayMs(viewModel); + foreach (DelayOption option in cbDelay.Items) + { + if (option.Value == currentDelayMs) + { + cbDelay.SelectedItem = option; + break; + } + } + } + } + + private int GetCurrentDelayMs(ViewModel.PluginViewModel viewModel) + { + // SearchDelayTime enum 값을 int로 변환 + SearchDelayTime? delayTime = viewModel.PluginPair.Metadata.SearchDelayTime; + if (delayTime.HasValue) + { + return (int)delayTime.Value; + } + return 0; // 기본값 + } + + private void LoadDelayOptions() + { + // 검색 지연 시간 옵션들 (SearchDelayTime enum 값에 맞춰야 함) + var delayOptions = new List + { + new DelayOption { Display = "0 ms", Value = 0 }, + new DelayOption { Display = "50 ms", Value = 50 }, + new DelayOption { Display = "100 ms", Value = 100 }, + new DelayOption { Display = "150 ms", Value = 150 }, + new DelayOption { Display = "200 ms", Value = 200 }, + new DelayOption { Display = "250 ms", Value = 250 }, + new DelayOption { Display = "300 ms", Value = 300 }, + new DelayOption { Display = "350 ms", Value = 350 }, + new DelayOption { Display = "400 ms", Value = 400 }, + new DelayOption { Display = "450 ms", Value = 450 }, + new DelayOption { Display = "500 ms", Value = 500 }, + }; + + cbDelay.ItemsSource = delayOptions; + } + + private void CbDelay_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (DataContext is ViewModel.PluginViewModel viewModel && cbDelay.SelectedItem is DelayOption selectedOption) + { + // int 값을 SearchDelayTime enum으로 변환 + int delayValue = selectedOption.Value; + viewModel.PluginPair.Metadata.SearchDelayTime = (SearchDelayTime)delayValue; + + // 설정 저장 + //How to save? + } + } + } + + public class DelayOption + { + public string Display { get; set; } + public int Value { get; set; } + } +} From a65e89b86fbe3e1134c1a098f9af85ed4ea8bf71 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 5 Apr 2025 01:06:06 +0900 Subject: [PATCH 06/27] Adjust advanced control UI --- .../SettingsPanePluginsViewModel.cs | 22 +++++ .../Views/SettingsPaneGeneral.xaml | 21 ++++ .../Views/SettingsPanePlugins.xaml | 97 +++++++++++++------ .../Views/SettingsPanePlugins.xaml.cs | 9 ++ 4 files changed, 117 insertions(+), 32 deletions(-) diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs index 5cd14ba7e..69d31a98d 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs @@ -14,6 +14,28 @@ public class SettingsPanePluginsViewModel : BaseModel { private readonly Settings _settings; + public void UpdateDisplayModeFromSelection() + { + switch (CurrentDisplayMode) + { + case "OnOff": + IsOnOffSelected = true; + IsPrioritySelected = false; + IsSearchDelaySelected = false; + break; + case "Priority": + IsOnOffSelected = false; + IsPrioritySelected = true; + IsSearchDelaySelected = false; + break; + case "SearchDelay": + IsOnOffSelected = false; + IsPrioritySelected = false; + IsSearchDelaySelected = true; + break; + } + } + private bool _isOnOffSelected = true; public bool IsOnOffSelected { diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml index 3f8272dda..e36c647a2 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml @@ -196,6 +196,27 @@ + + + + + + + + + @@ -34,34 +34,35 @@ Text="{DynamicResource plugins}" TextAlignment="Left" /> - + + - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Flow.Launcher/SearchDelayTimeWindow.xaml.cs b/Flow.Launcher/SearchDelayTimeWindow.xaml.cs deleted file mode 100644 index 4a3c9f5a7..000000000 --- a/Flow.Launcher/SearchDelayTimeWindow.xaml.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Linq; -using System.Windows; -using Flow.Launcher.Plugin; -using Flow.Launcher.SettingPages.ViewModels; -using Flow.Launcher.ViewModel; -using static Flow.Launcher.SettingPages.ViewModels.SettingsPaneGeneralViewModel; - -namespace Flow.Launcher; - -public partial class SearchDelayTimeWindow : Window -{ - private readonly PluginViewModel _pluginViewModel; - - public SearchDelayTimeWindow(PluginViewModel pluginViewModel) - { - InitializeComponent(); - _pluginViewModel = pluginViewModel; - } - - private void SearchDelayTimeWindow_OnLoaded(object sender, RoutedEventArgs e) - { - tbSearchDelayTimeTips.Text = string.Format(App.API.GetTranslation("searchDelayTime_tips"), - App.API.GetTranslation("default")); - tbOldSearchDelayTime.Text = _pluginViewModel.SearchDelayTimeText; - var searchDelayTimes = DropdownDataGeneric.GetValues("SearchDelayTime"); - SearchDelayTimeData selected = null; - // 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); - } - // Add default value to the beginning of the list - // When _pluginViewModel.PluginSearchDelayTime equals null, we will select this - searchDelayTimes.Insert(0, new SearchDelayTimeData { Display = App.API.GetTranslation("default"), LocalizationKey = "default" }); - selected ??= searchDelayTimes.FirstOrDefault(); - cbDelay.ItemsSource = searchDelayTimes; - cbDelay.SelectedItem = selected; - cbDelay.Focus(); - } - - private void BtnCancel_OnClick(object sender, RoutedEventArgs e) - { - Close(); - } - - private void btnDone_OnClick(object sender, RoutedEventArgs _) - { - // Update search delay time - var selected = cbDelay.SelectedItem as SearchDelayTimeData; - SearchDelayTime? changedValue = selected?.LocalizationKey != "default" ? selected.Value : null; - _pluginViewModel.PluginSearchDelayTime = changedValue; - - // Update search delay time text and close window - _pluginViewModel.OnSearchDelayTimeChanged(); - Close(); - } -} diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs index cec8c318c..74e2d8340 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Windows.Forms; +using CommunityToolkit.Mvvm.DependencyInjection; using CommunityToolkit.Mvvm.Input; using Flow.Launcher.Core; using Flow.Launcher.Core.Configuration; @@ -31,7 +32,25 @@ public partial class SettingsPaneGeneralViewModel : BaseModel public class SearchWindowAlignData : DropdownDataGeneric { } public class SearchPrecisionData : DropdownDataGeneric { } public class LastQueryModeData : DropdownDataGeneric { } - public class SearchDelayTimeData : 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 { @@ -144,19 +163,15 @@ public partial class SettingsPaneGeneralViewModel : BaseModel public List LastQueryModes { get; } = DropdownDataGeneric.GetValues("LastQuery"); - public List SearchDelayTimes { get; } = - DropdownDataGeneric.GetValues("SearchDelayTime"); + public List SearchDelayTimes { get; } = SearchDelayTimeData.GetValues(); public SearchDelayTimeData SearchDelayTime { - get => SearchDelayTimes.FirstOrDefault(x => x.Value == Settings.SearchDelayTime) ?? - SearchDelayTimes.FirstOrDefault(x => x.Value == Plugin.SearchDelayTime.Normal) ?? - SearchDelayTimes.FirstOrDefault(); + get => SearchDelayTimes.FirstOrDefault(x => x.Value == Settings.SearchDelayTime); set { - if (value == null) - return; - + if (value == null) return; + if (Settings.SearchDelayTime != value.Value) { Settings.SearchDelayTime = value.Value; @@ -170,7 +185,6 @@ public partial class SettingsPaneGeneralViewModel : BaseModel DropdownDataGeneric.UpdateLabels(SearchWindowAligns); DropdownDataGeneric.UpdateLabels(SearchPrecisionScores); DropdownDataGeneric.UpdateLabels(LastQueryModes); - DropdownDataGeneric.UpdateLabels(SearchDelayTimes); } public string Language diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml index e36c647a2..10e2b549a 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml @@ -196,18 +196,21 @@ - + - - + Sub="{DynamicResource searchDelayTimeToolTip}" + Type="InsideFit"> - + 250, - SearchDelayTime.Long => 200, - SearchDelayTime.Normal => 150, - SearchDelayTime.Short => 100, - SearchDelayTime.VeryShort => 50, - _ => 150 - }; + var searchDelayTime = plugin.Metadata.SearchDelayTime ?? Settings.SearchDelayTime; await Task.Delay(searchDelayTime, token); diff --git a/Flow.Launcher/ViewModel/PluginViewModel.cs b/Flow.Launcher/ViewModel/PluginViewModel.cs index 2016d9c98..bf61b1902 100644 --- a/Flow.Launcher/ViewModel/PluginViewModel.cs +++ b/Flow.Launcher/ViewModel/PluginViewModel.cs @@ -95,7 +95,7 @@ namespace Flow.Launcher.ViewModel } } - public SearchDelayTime? PluginSearchDelayTime + public int? PluginSearchDelayTime { get => PluginPair.Metadata.SearchDelayTime; set @@ -192,12 +192,5 @@ namespace Flow.Launcher.ViewModel var changeKeywordsWindow = new ActionKeywords(this); changeKeywordsWindow.ShowDialog(); } - - [RelayCommand] - private void SetSearchDelayTime() - { - var searchDelayTimeWindow = new SearchDelayTimeWindow(this); - searchDelayTimeWindow.ShowDialog(); - } } } diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json b/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json index 64681f803..c8b6310a7 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": "VeryLong" + "SearchDelayTime": 450 } From dfb6b0a3a300386fe668148d0429de9db7ea9b3a Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 7 Apr 2025 14:26:35 +0800 Subject: [PATCH 16/27] Fix string resource issue --- .../SettingPages/ViewModels/SettingsPanePluginsViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs index af1653c93..46e398eb5 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs @@ -141,7 +141,7 @@ public partial class SettingsPanePluginsViewModel : BaseModel }, new TextBlock { - Text = (string)Application.Current.Resources["searchDelayTime_tips"], + Text = (string)Application.Current.Resources["searchDelayTimeTips"], TextWrapping = TextWrapping.Wrap } } From 24bbfcc4139596ac6d3929da44e353508f426974 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 7 Apr 2025 14:27:33 +0800 Subject: [PATCH 17/27] Support numerical box for priority --- Flow.Launcher/PriorityChangeWindow.xaml | 121 ------------------ Flow.Launcher/PriorityChangeWindow.xaml.cs | 67 ---------- .../Controls/InstalledPluginDisplay.xaml | 3 +- Flow.Launcher/ViewModel/PluginViewModel.cs | 20 +-- 4 files changed, 4 insertions(+), 207 deletions(-) delete mode 100644 Flow.Launcher/PriorityChangeWindow.xaml delete mode 100644 Flow.Launcher/PriorityChangeWindow.xaml.cs diff --git a/Flow.Launcher/PriorityChangeWindow.xaml b/Flow.Launcher/PriorityChangeWindow.xaml deleted file mode 100644 index 33ed54bb4..000000000 --- a/Flow.Launcher/PriorityChangeWindow.xaml +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Flow.Launcher/PriorityChangeWindow.xaml.cs b/Flow.Launcher/PriorityChangeWindow.xaml.cs deleted file mode 100644 index fbe2a941d..000000000 --- a/Flow.Launcher/PriorityChangeWindow.xaml.cs +++ /dev/null @@ -1,67 +0,0 @@ -using Flow.Launcher.Core.Plugin; -using Flow.Launcher.Core.Resource; -using Flow.Launcher.Plugin; -using Flow.Launcher.ViewModel; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; -using Flow.Launcher.Core; - -namespace Flow.Launcher -{ - /// - /// Interaction Logic of PriorityChangeWindow.xaml - /// - public partial class PriorityChangeWindow : Window - { - private readonly PluginPair plugin; - private readonly Internationalization translater = InternationalizationManager.Instance; - private readonly PluginViewModel pluginViewModel; - public PriorityChangeWindow(string pluginId, PluginViewModel pluginViewModel) - { - InitializeComponent(); - plugin = PluginManager.GetPluginForId(pluginId); - this.pluginViewModel = pluginViewModel; - if (plugin == null) - { - App.API.ShowMsgBox(translater.GetTranslation("cannotFindSpecifiedPlugin")); - Close(); - } - } - - private void BtnCancel_OnClick(object sender, RoutedEventArgs e) - { - Close(); - } - - private void btnDone_OnClick(object sender, RoutedEventArgs e) - { - if (int.TryParse(tbAction.Text.Trim(), out var newPriority)) - { - pluginViewModel.ChangePriority(newPriority); - Close(); - } - else - { - string msg = translater.GetTranslation("invalidPriority"); - App.API.ShowMsgBox(msg); - } - - } - - private void PriorityChangeWindow_Loaded(object sender, RoutedEventArgs e) - { - tbAction.Text = pluginViewModel.Priority.ToString(); - tbAction.Focus(); - } - private void window_MouseDown(object sender, MouseButtonEventArgs e) /* for close hotkey popup */ - { - TextBox textBox = Keyboard.FocusedElement as TextBox; - if (textBox != null) - { - TraversalRequest tRequest = new TraversalRequest(FocusNavigationDirection.Next); - textBox.MoveFocus(tRequest); - } - } - } -} diff --git a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml index 5ba011fed..778f00160 100644 --- a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml +++ b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml @@ -70,7 +70,8 @@ Maximum="999" Minimum="-999" SpinButtonPlacementMode="Inline" - ToolTip="{DynamicResource priorityToolTip}" /> + ToolTip="{DynamicResource priorityToolTip}" + Value="{Binding Priority, Mode=TwoWay}" /> PluginPair.Metadata.Priority; set { - if (PluginPair.Metadata.Priority != value) - { - ChangePriority(value); - } + PluginPair.Metadata.Priority = value; + PluginSettingsObject.Priority = value; } } @@ -151,20 +149,6 @@ namespace Flow.Launcher.ViewModel OnPropertyChanged(nameof(SearchDelayTimeText)); } - public void ChangePriority(int newPriority) - { - PluginPair.Metadata.Priority = newPriority; - PluginSettingsObject.Priority = newPriority; - OnPropertyChanged(nameof(Priority)); - } - - [RelayCommand] - private void EditPluginPriority() - { - var priorityChangeWindow = new PriorityChangeWindow(PluginPair. Metadata.ID, this); - priorityChangeWindow.ShowDialog(); - } - [RelayCommand] private void OpenPluginDirectory() { From 67268284e0e4ae612a5395973a58b6674b203c4f Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 7 Apr 2025 14:40:27 +0800 Subject: [PATCH 18/27] Support numerical box for search delay --- .../Controls/InstalledPluginDisplay.xaml | 3 ++- Flow.Launcher/ViewModel/PluginViewModel.cs | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml index 778f00160..f57c0e2d9 100644 --- a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml +++ b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml @@ -91,7 +91,8 @@ Maximum="1000" Minimum="0" SpinButtonPlacementMode="Inline" - ToolTip="{DynamicResource searchDelayToolTip}" /> + ToolTip="{DynamicResource searchDelayToolTip}" + Value="{Binding PluginSearchDelayTime, Mode=TwoWay}" /> diff --git a/Flow.Launcher/ViewModel/PluginViewModel.cs b/Flow.Launcher/ViewModel/PluginViewModel.cs index 22a69592b..2dff72ac5 100644 --- a/Flow.Launcher/ViewModel/PluginViewModel.cs +++ b/Flow.Launcher/ViewModel/PluginViewModel.cs @@ -93,13 +93,23 @@ namespace Flow.Launcher.ViewModel } } - public int? PluginSearchDelayTime + public double PluginSearchDelayTime { - get => PluginPair.Metadata.SearchDelayTime; + get => PluginPair.Metadata.SearchDelayTime == null ? + double.NaN : + PluginPair.Metadata.SearchDelayTime.Value; set { - PluginPair.Metadata.SearchDelayTime = value; - PluginSettingsObject.SearchDelayTime = value; + if (double.IsNaN(value)) + { + PluginPair.Metadata.SearchDelayTime = null; + PluginSettingsObject.SearchDelayTime = null; + } + else + { + PluginPair.Metadata.SearchDelayTime = (int)value; + PluginSettingsObject.SearchDelayTime = (int)value; + } } } From 65f48e3069c173e3f2be4ff255d405112dd0f29f Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 7 Apr 2025 14:54:09 +0800 Subject: [PATCH 19/27] Force priority to 0 when inputing empty --- .../Resources/Controls/InstalledPluginDisplay.xaml | 1 + .../Controls/InstalledPluginDisplay.xaml.cs | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml index f57c0e2d9..ece66034c 100644 --- a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml +++ b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml @@ -71,6 +71,7 @@ Minimum="-999" SpinButtonPlacementMode="Inline" ToolTip="{DynamicResource priorityToolTip}" + ValueChanged="NumberBox_OnValueChanged" Value="{Binding Priority, Mode=TwoWay}" /> diff --git a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml.cs b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml.cs index dfa03a204..ab9496266 100644 --- a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml.cs +++ b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml.cs @@ -1,4 +1,6 @@ -namespace Flow.Launcher.Resources.Controls; +using ModernWpf.Controls; + +namespace Flow.Launcher.Resources.Controls; public partial class InstalledPluginDisplay { @@ -6,4 +8,12 @@ public partial class InstalledPluginDisplay { InitializeComponent(); } + + private void NumberBox_OnValueChanged(NumberBox sender, NumberBoxValueChangedEventArgs args) + { + if (double.IsNaN(args.NewValue)) + { + sender.Value = 0; + } + } } From e955e47e5fafcf54b6aa651dcc04db7ed9355523 Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 7 Apr 2025 22:47:39 +0900 Subject: [PATCH 20/27] - 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"> - + + + From cbf50317d3cb87bd62dbb42ee39adcd6719bbeee Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 8 Apr 2025 00:02:59 +0900 Subject: [PATCH 21/27] Fix content dialog style --- .../Resources/CustomControlTemplate.xaml | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Flow.Launcher/Resources/CustomControlTemplate.xaml b/Flow.Launcher/Resources/CustomControlTemplate.xaml index 157910b4a..d78829471 100644 --- a/Flow.Launcher/Resources/CustomControlTemplate.xaml +++ b/Flow.Launcher/Resources/CustomControlTemplate.xaml @@ -3587,7 +3587,7 @@ - + - + + + + + + + + From d30f292e3129aeab196b21380a3076f860a976e3 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 8 Apr 2025 20:19:04 +0800 Subject: [PATCH 22/27] Remove unused string --- Flow.Launcher/Languages/en.xaml | 1 - 1 file changed, 1 deletion(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index f01d0575a..7e5a554a9 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -149,7 +149,6 @@ Plugins: {0} - Fail to remove plugin settings files, please remove them manually Fail to remove plugin cache Plugins: {0} - Fail to remove plugin cache files, please remove them manually - Default Plugin Store From 970bb3ac1268f8e3e443f48aef77d80324b2da15 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 8 Apr 2025 20:30:40 +0800 Subject: [PATCH 23/27] Add code comments --- Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml.cs b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml.cs index ab9496266..a27a00782 100644 --- a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml.cs +++ b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml.cs @@ -9,6 +9,7 @@ public partial class InstalledPluginDisplay InitializeComponent(); } + // This is used for PriorityControl to force its value to be 0 when the user clears the value private void NumberBox_OnValueChanged(NumberBox sender, NumberBoxValueChangedEventArgs args) { if (double.IsNaN(args.NewValue)) From 61fa4602d529c345616aaea87dd65af14589f77c Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 8 Apr 2025 21:02:42 +0800 Subject: [PATCH 24/27] Disable search delay number box when search delay is disabled --- .../Resources/Controls/InstalledPluginDisplay.xaml | 9 +++++---- Flow.Launcher/ViewModel/PluginViewModel.cs | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml index 9a4e3b7b0..63d1af6b1 100644 --- a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml +++ b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml @@ -90,13 +90,14 @@ - + Value="{Binding PluginSearchDelayTime, Mode=TwoWay}" /> diff --git a/Flow.Launcher/ViewModel/PluginViewModel.cs b/Flow.Launcher/ViewModel/PluginViewModel.cs index 2dff72ac5..5f19459c9 100644 --- a/Flow.Launcher/ViewModel/PluginViewModel.cs +++ b/Flow.Launcher/ViewModel/PluginViewModel.cs @@ -3,9 +3,11 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Media; +using CommunityToolkit.Mvvm.DependencyInjection; using CommunityToolkit.Mvvm.Input; using Flow.Launcher.Core.Plugin; using Flow.Launcher.Infrastructure.Image; +using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; using Flow.Launcher.Resources.Controls; @@ -13,6 +15,8 @@ namespace Flow.Launcher.ViewModel { public partial class PluginViewModel : BaseModel { + private static readonly Settings Settings = Ioc.Default.GetRequiredService(); + private readonly PluginPair _pluginPair; public PluginPair PluginPair { @@ -148,6 +152,7 @@ namespace Flow.Launcher.ViewModel App.API.GetTranslation("default") : App.API.GetTranslation($"SearchDelayTime{PluginPair.Metadata.SearchDelayTime}"); public Infrastructure.UserSettings.Plugin PluginSettingsObject{ get; init; } + public bool SearchDelayEnabled => Settings.SearchQueryResultsWithDelay; public void OnActionKeywordsChanged() { From ade4fbf7f2a905ef41cdf98e82dcd484d1400367 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 8 Apr 2025 21:02:56 +0800 Subject: [PATCH 25/27] Adjust number box width --- Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml index 63d1af6b1..4a89d811f 100644 --- a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml +++ b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml @@ -88,7 +88,7 @@ Text="{DynamicResource searchDelay}" ToolTip="{DynamicResource searchDelayToolTip}" /> Date: Tue, 8 Apr 2025 21:04:04 +0800 Subject: [PATCH 26/27] Change default search delay time to value --- Flow.Launcher/Languages/en.xaml | 1 - Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml | 2 +- Flow.Launcher/ViewModel/PluginViewModel.cs | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 7e5a554a9..609859d0d 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -111,7 +111,6 @@ Adds a short delay while typing to reduce UI flicker and result load. Recommended if your typing speed is average. Default Search Delay Time 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 4a89d811f..231036244 100644 --- a/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml +++ b/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml @@ -93,7 +93,7 @@ IsEnabled="{Binding SearchDelayEnabled}" Maximum="1000" Minimum="0" - PlaceholderText="{DynamicResource searchDelayPlaceHolder}" + PlaceholderText="{Binding DefaultSearchDelay}" SmallChange="10" SpinButtonPlacementMode="Compact" ToolTip="{DynamicResource searchDelayToolTip}" diff --git a/Flow.Launcher/ViewModel/PluginViewModel.cs b/Flow.Launcher/ViewModel/PluginViewModel.cs index 5f19459c9..da0ed70fa 100644 --- a/Flow.Launcher/ViewModel/PluginViewModel.cs +++ b/Flow.Launcher/ViewModel/PluginViewModel.cs @@ -153,6 +153,7 @@ namespace Flow.Launcher.ViewModel App.API.GetTranslation($"SearchDelayTime{PluginPair.Metadata.SearchDelayTime}"); public Infrastructure.UserSettings.Plugin PluginSettingsObject{ get; init; } public bool SearchDelayEnabled => Settings.SearchQueryResultsWithDelay; + public string DefaultSearchDelay => Settings.SearchDelayTime.ToString(); public void OnActionKeywordsChanged() { From d09899e15c32be3d1755b6222cdae4919735d2fd Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 8 Apr 2025 22:31:33 +0900 Subject: [PATCH 27/27] Adjust Placeholder color --- .../Resources/CustomControlTemplate.xaml | 25 +++++++++++-------- Flow.Launcher/Resources/Dark.xaml | 1 + Flow.Launcher/Resources/Light.xaml | 3 +++ 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Flow.Launcher/Resources/CustomControlTemplate.xaml b/Flow.Launcher/Resources/CustomControlTemplate.xaml index d78829471..ffa5eea41 100644 --- a/Flow.Launcher/Resources/CustomControlTemplate.xaml +++ b/Flow.Launcher/Resources/CustomControlTemplate.xaml @@ -2777,7 +2777,7 @@ - + @@ -3587,7 +3587,7 @@ - + - + - + diff --git a/Flow.Launcher/Resources/Dark.xaml b/Flow.Launcher/Resources/Dark.xaml index e8629a981..498e96bff 100644 --- a/Flow.Launcher/Resources/Dark.xaml +++ b/Flow.Launcher/Resources/Dark.xaml @@ -106,6 +106,7 @@ #f5f5f5 #464646 #ffffff + #272727 diff --git a/Flow.Launcher/Resources/Light.xaml b/Flow.Launcher/Resources/Light.xaml index aa6da9fb2..0f1e98a6b 100644 --- a/Flow.Launcher/Resources/Light.xaml +++ b/Flow.Launcher/Resources/Light.xaml @@ -97,8 +97,11 @@ #f5f5f5 #878787 #1b1b1b + #f6f6f6 + +