Add UI for Explorer plugin's MaxResult setting

This commit is contained in:
Ishmaeel 2024-08-05 23:34:24 +10:00
parent 2e078d7d0e
commit 578b4cb6c5
4 changed files with 36 additions and 1 deletions

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
@ -48,6 +48,7 @@
<PackageReference Include="System.Data.OleDb" Version="8.0.0" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="tlbimp-Microsoft.Search.Interop" Version="1.0.0" />
<PackageReference Include="ModernWpfUI" Version="0.9.4" />
</ItemGroup>
<ItemGroup>

View file

@ -66,6 +66,8 @@
<system:String x:Key="plugin_explorer_Open_Window_Index_Option">Open Windows Index Option</system:String>
<system:String x:Key="plugin_explorer_Excluded_File_Types">Excluded File Types (comma seperated)</system:String>
<system:String x:Key="plugin_explorer_Excluded_File_Types_Tooltip">For example: exe,jpg,png</system:String>
<system:String x:Key="plugin_explorer_Maximum_Results">Maximum results</system:String>
<system:String x:Key="plugin_explorer_Maximum_Results_Tooltip">The maximum number of results requested from active search engine</system:String>
<!-- Plugin Infos -->
<system:String x:Key="plugin_explorer_plugin_name">Explorer</system:String>

View file

@ -525,6 +525,16 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels
}
}
public int MaxResult
{
get => Settings.MaxResult;
set
{
Settings.MaxResult = Math.Clamp(value, 0, 10000);
OnPropertyChanged();
}
}
#region Everything FastSortWarning

View file

@ -282,6 +282,7 @@
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock
Grid.Row="0"
@ -348,6 +349,27 @@
Margin="0,9,0,6"
ToolTip="{DynamicResource plugin_explorer_Excluded_File_Types_Tooltip}"
Text="{Binding ExcludedFileTypes}" />
<TextBlock
Grid.Row="4"
Grid.Column="0"
Margin="0 15 20 0"
VerticalAlignment="Center"
Text="{DynamicResource plugin_explorer_Maximum_Results}"
TextBlock.Foreground="{DynamicResource Color05B}" />
<ui:NumberBox
Grid.Row="4"
Grid.Column="1"
MinWidth="350"
Maximum="10000"
Minimum="0"
Margin="0,9,0,6"
HorizontalAlignment="Left"
VerticalAlignment="Center"
CornerRadius="4"
SmallChange="10"
SpinButtonPlacementMode="Inline"
Value="{Binding MaxResult}"
ToolTip="{DynamicResource plugin_explorer_Maximum_Results_Tooltip}"/>
</Grid>
</StackPanel>
<StackPanel Orientation="Horizontal">