Skip to content

Commit 61fa460

Browse files
committed
Disable search delay number box when search delay is disabled
1 parent 970bb3a commit 61fa460

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,14 @@
9090
<ui:NumberBox
9191
Width="160"
9292
Margin="0 0 8 0"
93+
IsEnabled="{Binding SearchDelayEnabled}"
9394
Maximum="1000"
94-
SmallChange="10"
9595
Minimum="0"
96-
SpinButtonPlacementMode="Compact" PlaceholderText="{DynamicResource searchDelayPlaceHolder}"
96+
PlaceholderText="{DynamicResource searchDelayPlaceHolder}"
97+
SmallChange="10"
98+
SpinButtonPlacementMode="Compact"
9799
ToolTip="{DynamicResource searchDelayToolTip}"
98-
Value="{Binding PluginSearchDelayTime, Mode=TwoWay}">
99-
</ui:NumberBox>
100+
Value="{Binding PluginSearchDelayTime, Mode=TwoWay}" />
100101
</StackPanel>
101102

102103
<!-- Put OnOffControl after PriorityControl & SearchDelayControl so that it can display correctly -->

Flow.Launcher/ViewModel/PluginViewModel.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@
33
using System.Windows;
44
using System.Windows.Controls;
55
using System.Windows.Media;
6+
using CommunityToolkit.Mvvm.DependencyInjection;
67
using CommunityToolkit.Mvvm.Input;
78
using Flow.Launcher.Core.Plugin;
89
using Flow.Launcher.Infrastructure.Image;
10+
using Flow.Launcher.Infrastructure.UserSettings;
911
using Flow.Launcher.Plugin;
1012
using Flow.Launcher.Resources.Controls;
1113

1214
namespace Flow.Launcher.ViewModel
1315
{
1416
public partial class PluginViewModel : BaseModel
1517
{
18+
private static readonly Settings Settings = Ioc.Default.GetRequiredService<Settings>();
19+
1620
private readonly PluginPair _pluginPair;
1721
public PluginPair PluginPair
1822
{
@@ -148,6 +152,7 @@ public Control SettingControl
148152
App.API.GetTranslation("default") :
149153
App.API.GetTranslation($"SearchDelayTime{PluginPair.Metadata.SearchDelayTime}");
150154
public Infrastructure.UserSettings.Plugin PluginSettingsObject{ get; init; }
155+
public bool SearchDelayEnabled => Settings.SearchQueryResultsWithDelay;
151156

152157
public void OnActionKeywordsChanged()
153158
{

0 commit comments

Comments
 (0)