Skip to content

Commit 578b4cb

Browse files
committed
Add UI for Explorer plugin's MaxResult setting
1 parent 2e078d7 commit 578b4cb

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFramework>net7.0-windows</TargetFramework>
5+
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
66
<UseWPF>true</UseWPF>
77
<UseWindowsForms>true</UseWindowsForms>
88
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
@@ -48,6 +48,7 @@
4848
<PackageReference Include="System.Data.OleDb" Version="8.0.0" />
4949
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
5050
<PackageReference Include="tlbimp-Microsoft.Search.Interop" Version="1.0.0" />
51+
<PackageReference Include="ModernWpfUI" Version="0.9.4" />
5152
</ItemGroup>
5253

5354
<ItemGroup>

Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
<system:String x:Key="plugin_explorer_Open_Window_Index_Option">Open Windows Index Option</system:String>
6767
<system:String x:Key="plugin_explorer_Excluded_File_Types">Excluded File Types (comma seperated)</system:String>
6868
<system:String x:Key="plugin_explorer_Excluded_File_Types_Tooltip">For example: exe,jpg,png</system:String>
69+
<system:String x:Key="plugin_explorer_Maximum_Results">Maximum results</system:String>
70+
<system:String x:Key="plugin_explorer_Maximum_Results_Tooltip">The maximum number of results requested from active search engine</system:String>
6971

7072
<!-- Plugin Infos -->
7173
<system:String x:Key="plugin_explorer_plugin_name">Explorer</system:String>

Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,16 @@ public string ExcludedFileTypes
525525
}
526526
}
527527

528+
public int MaxResult
529+
{
530+
get => Settings.MaxResult;
531+
set
532+
{
533+
Settings.MaxResult = Math.Clamp(value, 0, 10000);
534+
OnPropertyChanged();
535+
}
536+
}
537+
528538

529539
#region Everything FastSortWarning
530540

Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@
282282
<RowDefinition />
283283
<RowDefinition />
284284
<RowDefinition />
285+
<RowDefinition />
285286
</Grid.RowDefinitions>
286287
<TextBlock
287288
Grid.Row="0"
@@ -348,6 +349,27 @@
348349
Margin="0,9,0,6"
349350
ToolTip="{DynamicResource plugin_explorer_Excluded_File_Types_Tooltip}"
350351
Text="{Binding ExcludedFileTypes}" />
352+
<TextBlock
353+
Grid.Row="4"
354+
Grid.Column="0"
355+
Margin="0 15 20 0"
356+
VerticalAlignment="Center"
357+
Text="{DynamicResource plugin_explorer_Maximum_Results}"
358+
TextBlock.Foreground="{DynamicResource Color05B}" />
359+
<ui:NumberBox
360+
Grid.Row="4"
361+
Grid.Column="1"
362+
MinWidth="350"
363+
Maximum="10000"
364+
Minimum="0"
365+
Margin="0,9,0,6"
366+
HorizontalAlignment="Left"
367+
VerticalAlignment="Center"
368+
CornerRadius="4"
369+
SmallChange="10"
370+
SpinButtonPlacementMode="Inline"
371+
Value="{Binding MaxResult}"
372+
ToolTip="{DynamicResource plugin_explorer_Maximum_Results_Tooltip}"/>
351373
</Grid>
352374
</StackPanel>
353375
<StackPanel Orientation="Horizontal">

0 commit comments

Comments
 (0)