Skip to content

Commit 6726828

Browse files
committed
Support numerical box for search delay
1 parent 24bbfcc commit 6726828

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@
9191
Maximum="1000"
9292
Minimum="0"
9393
SpinButtonPlacementMode="Inline"
94-
ToolTip="{DynamicResource searchDelayToolTip}" />
94+
ToolTip="{DynamicResource searchDelayToolTip}"
95+
Value="{Binding PluginSearchDelayTime, Mode=TwoWay}" />
9596
</StackPanel>
9697

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

Flow.Launcher/ViewModel/PluginViewModel.cs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,23 @@ public int Priority
9393
}
9494
}
9595

96-
public int? PluginSearchDelayTime
96+
public double PluginSearchDelayTime
9797
{
98-
get => PluginPair.Metadata.SearchDelayTime;
98+
get => PluginPair.Metadata.SearchDelayTime == null ?
99+
double.NaN :
100+
PluginPair.Metadata.SearchDelayTime.Value;
99101
set
100102
{
101-
PluginPair.Metadata.SearchDelayTime = value;
102-
PluginSettingsObject.SearchDelayTime = value;
103+
if (double.IsNaN(value))
104+
{
105+
PluginPair.Metadata.SearchDelayTime = null;
106+
PluginSettingsObject.SearchDelayTime = null;
107+
}
108+
else
109+
{
110+
PluginPair.Metadata.SearchDelayTime = (int)value;
111+
PluginSettingsObject.SearchDelayTime = (int)value;
112+
}
103113
}
104114
}
105115

0 commit comments

Comments
 (0)