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] 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() {