Skip to content

Commit dc7b812

Browse files
committed
Change search delay time to int & Improve code quality & Improve strings
1 parent 44f136c commit dc7b812

File tree

17 files changed

+52
-457
lines changed

17 files changed

+52
-457
lines changed

Flow.Launcher.Infrastructure/UserSettings/PluginSettings.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,9 @@ public class Plugin
120120
public int Priority { get; set; }
121121

122122
[JsonIgnore]
123-
public SearchDelayTime? DefaultSearchDelayTime { get; set; }
123+
public int? DefaultSearchDelayTime { get; set; }
124124

125-
[JsonConverter(typeof(JsonStringEnumConverter))]
126-
public SearchDelayTime? SearchDelayTime { get; set; }
125+
public int? SearchDelayTime { get; set; }
127126

128127
/// <summary>
129128
/// Used only to save the state of the plugin in settings

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,10 @@ public bool HideNotifyIcon
322322

323323
public bool SearchQueryResultsWithDelay { get; set; }
324324

325-
[JsonConverter(typeof(JsonStringEnumConverter))]
326-
public SearchDelayTime SearchDelayTime { get; set; } = SearchDelayTime.Normal;
325+
[JsonIgnore]
326+
public IEnumerable<int> SearchDelayTimeRange = new List<int> { 50, 100, 150, 200, 250, 300, 350, 400, 450, 500 };
327+
328+
public int SearchDelayTime { get; set; } = 150;
327329

328330
[JsonConverter(typeof(JsonStringEnumConverter))]
329331
public SearchWindowScreens SearchWindowScreen { get; set; } = SearchWindowScreens.Cursor;

Flow.Launcher.Plugin/PluginMetadata.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,9 @@ internal set
9999
public bool HideActionKeywordPanel { get; set; }
100100

101101
/// <summary>
102-
/// Plugin search delay time. Null means use default search delay time.
102+
/// Plugin search delay time in ms. Null means use default search delay time.
103103
/// </summary>
104-
[JsonConverter(typeof(JsonStringEnumConverter))]
105-
public SearchDelayTime? SearchDelayTime { get; set; } = null;
104+
public int? SearchDelayTime { get; set; } = null;
106105

107106
/// <summary>
108107
/// Plugin icon path.

Flow.Launcher.Plugin/SearchDelayTime.cs

Lines changed: 0 additions & 32 deletions
This file was deleted.

Flow.Launcher/Languages/en.xaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,7 @@
380380

381381
<!-- Search Delay Settings Dialog -->
382382
<system:String x:Key="searchDelayTimeTitle">Search Delay Time Setting</system:String>
383-
<system:String x:Key="searchDelayTime_tips">Select the search delay time you like to use for the plugin. Select "{0}" if you don't want to specify any, and the plugin will use default search delay time.</system:String>
384-
<system:String x:Key="currentSearchDelayTime">Current search delay time</system:String>
385-
<system:String x:Key="newSearchDelayTime">New search delay time</system:String>
383+
<system:String x:Key="searchDelayTimeTips">Input the search delay time in ms you like to use for the plugin. Input empty if you don't want to specify any, and the plugin will use default search delay time.</system:String>
386384

387385
<!-- Custom Query Hotkey Dialog -->
388386
<system:String x:Key="customeQueryHotkeyTitle">Custom Query Hotkey</system:String>

Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@
8585
Foreground="{DynamicResource Color08B}"
8686
Text="{DynamicResource searchDelay}"
8787
ToolTip="{DynamicResource searchDelayToolTip}" />
88-
<cc:InstalledPluginSearchDelayCombobox Margin="0 0 8 0" />
88+
<ui:NumberBox
89+
Margin="0 0 8 0"
90+
Maximum="1000"
91+
Minimum="0"
92+
SpinButtonPlacementMode="Inline"
93+
ToolTip="{DynamicResource searchDelayToolTip}" />
8994
</StackPanel>
9095

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

Flow.Launcher/Resources/Controls/InstalledPluginSearchDelay.xaml

Lines changed: 0 additions & 49 deletions
This file was deleted.

Flow.Launcher/Resources/Controls/InstalledPluginSearchDelay.xaml.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

Flow.Launcher/Resources/Controls/InstalledPluginSearchDelayCombobox.xaml

Lines changed: 0 additions & 39 deletions
This file was deleted.

Flow.Launcher/Resources/Controls/InstalledPluginSearchDelayCombobox.xaml.cs

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)