Merge remote-tracking branch 'upstream/dev' into FixProgramUID

This commit is contained in:
Vic 2022-11-14 15:25:40 +08:00
commit 2ea310ce37
9 changed files with 373 additions and 238 deletions

View file

@ -116,7 +116,7 @@
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="taskkill /f /fi &quot;IMAGENAME eq Flow.Launcher.exe&quot;" />
</Target>
<Target Name="RemoveDuplicateAnalyzers" BeforeTargets="CoreCompile">
<!-- Work around https://github.com/dotnet/wpf/issues/6792 -->

View file

@ -2044,31 +2044,43 @@
<Border Padding="{TemplateBinding Padding}">
<Grid Background="Transparent" SnapsToDevicePixels="False">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="19" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Ellipse
x:Name="circle"
Width="19"
Height="19"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stroke="Transparent" />
<Path
x:Name="arrow"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M 1,1.5 L 4.5,5 L 8,1.5"
SnapsToDevicePixels="false"
Stroke="#666"
StrokeThickness="1" />
<ContentPresenter
Grid.Column="1"
Margin="4,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Grid.Column="0"
Margin="0,0,0,0"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
RecognizesAccessKey="True"
SnapsToDevicePixels="True" />
<Grid
x:Name="ChevronGrid"
Grid.Column="1"
Margin="0"
VerticalAlignment="Center"
Background="Transparent"
RenderTransformOrigin="0.5, 0.5">
<Grid.RenderTransform>
<RotateTransform Angle="0" />
</Grid.RenderTransform>
<Ellipse
x:Name="circle"
Width="19"
Height="19"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stroke="Transparent" />
<Path
x:Name="arrow"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M 1,1.5 L 4.5,5 L 8,1.5"
SnapsToDevicePixels="false"
Stroke="#666"
StrokeThickness="1" />
</Grid>
</Grid>
</Border>
<ControlTemplate.Triggers>
@ -2077,12 +2089,12 @@
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="circle" Property="Stroke" Value="Transparent" />
<Setter TargetName="arrow" Property="Stroke" Value="#222" />
<Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Color05B}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="circle" Property="Stroke" Value="Transparent" />
<Setter TargetName="circle" Property="StrokeThickness" Value="1.5" />
<Setter TargetName="arrow" Property="Stroke" Value="#FF003366" />
<Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Color17B}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
@ -2110,7 +2122,7 @@
x:Name="HeaderSite"
MinWidth="0"
MinHeight="0"
Margin="18,0,0,0"
Margin="18,0,18,0"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
@ -2127,19 +2139,62 @@
Foreground="{TemplateBinding Foreground}"
IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Style="{StaticResource ExpanderDownHeaderStyle}" />
<ContentPresenter
x:Name="ExpandSite"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
DockPanel.Dock="Bottom"
Focusable="false"
Visibility="Collapsed" />
<Border x:Name="ContentPresenterBorder">
<ContentPresenter
x:Name="ExpandSite"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
DockPanel.Dock="Bottom"
Focusable="false" />
<Border.LayoutTransform>
<ScaleTransform ScaleY="0" />
</Border.LayoutTransform>
</Border>
</DockPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter TargetName="ExpandSite" Property="Visibility" Value="Visible" />
<Setter TargetName="ContentPresenterBorder" Property="BorderThickness" Value="0,1,0,0" />
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="ContentPresenterBorder"
Storyboard.TargetProperty="(Border.LayoutTransform).(ScaleTransform.ScaleY)"
From="0.0"
To="1.0"
Duration="00:00:00.00" />
<DoubleAnimation
Storyboard.TargetName="ContentPresenterBorder"
Storyboard.TargetProperty="(Border.Opacity)"
From="0.0"
To="1.0"
Duration="00:00:00.00" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="ContentPresenterBorder"
Storyboard.TargetProperty="(Border.LayoutTransform).(ScaleTransform.ScaleY)"
From="1.0"
To="0"
Duration="00:00:00.00" />
<!-- Animation 00:00:00.167 -->
<DoubleAnimation
Storyboard.TargetName="ContentPresenterBorder"
Storyboard.TargetProperty="(Border.Opacity)"
From="1.0"
To="0.0"
Duration="00:00:00.00" />
<!-- Animation 00:00:00.167 -->
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
<Trigger Property="ExpandDirection" Value="Right">
<Setter TargetName="ExpandSite" Property="DockPanel.Dock" Value="Right" />

View file

@ -48,10 +48,9 @@
<scm:SortDescription PropertyName="Source" />
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
<CollectionViewSource x:Key="PluginStoreCollectionView"
Source="{Binding ExternalPlugins}">
<CollectionViewSource x:Key="PluginStoreCollectionView" Source="{Binding ExternalPlugins}">
<CollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="Category"></PropertyGroupDescription>
<PropertyGroupDescription PropertyName="Category" />
</CollectionViewSource.GroupDescriptions>
</CollectionViewSource>
@ -95,7 +94,6 @@
<Setter Property="Margin" Value="0,5,0,0" />
<Setter Property="Padding" Value="0,15,0,15" />
<Setter Property="SnapsToDevicePixels" Value="True" />
</Style>
<Style x:Key="SettingTitleLabel" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="{DynamicResource Color05B}" />
@ -135,6 +133,7 @@
BasedOn="{StaticResource DefaultToggleSwitch}"
TargetType="{x:Type ui:ToggleSwitch}">
<Setter Property="Grid.Column" Value="2" />
<Setter Property="FocusVisualMargin" Value="5" />
<Setter Property="Width" Value="Auto" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="HorizontalContentAlignment" Value="Right" />
@ -262,12 +261,11 @@
</Setter>
</Style>
<!-- Plugin Store Item when Selected layout for nothing -->
<Style x:Key="StoreItem" TargetType="{x:Type ToggleButton}" />
<Style x:Key="PluginList" TargetType="ListBoxItem">
<Setter Property="Background" Value="{DynamicResource Color00B}" />
<Setter Property="Padding" Value="0,12,0,12" />
<Setter Property="Padding" Value="0,0,0,0" />
<Setter Property="UseLayoutRounding" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Margin" Value="0,0,18,5" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="BorderBrush" Value="{DynamicResource Color03B}" />
@ -282,7 +280,7 @@
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="5"
SnapsToDevicePixels="True">
UseLayoutRounding="True">
<ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
@ -398,6 +396,7 @@
x:Key="StoreListStyle"
BasedOn="{StaticResource {x:Type ListBox}}"
TargetType="ListBox">
<Setter Property="Background" Value="{DynamicResource Color01B}" />
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Items.Count}" Value="0">
<Setter Property="Template">
@ -630,7 +629,11 @@
<StackPanel Style="{StaticResource TextPanel}">
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource startFlowLauncherOnSystemStartup}" />
</StackPanel>
<CheckBox IsChecked="{Binding StartFlowLauncherOnSystemStartup}" Style="{DynamicResource SideControlCheckBox}" />
<ui:ToggleSwitch
Grid.Column="2"
FocusVisualMargin="5"
IsOn="{Binding StartFlowLauncherOnSystemStartup}"
Style="{DynamicResource SideToggleSwitch}" />
<TextBlock Style="{StaticResource Glyph}">
&#xe8fc;
</TextBlock>
@ -642,7 +645,11 @@
<StackPanel Style="{StaticResource TextPanel}">
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource hideOnStartup}" />
</StackPanel>
<CheckBox IsChecked="{Binding Settings.HideOnStartup}" Style="{DynamicResource SideControlCheckBox}" />
<ui:ToggleSwitch
Grid.Column="2"
FocusVisualMargin="5"
IsOn="{Binding Settings.HideOnStartup}"
Style="{DynamicResource SideToggleSwitch}" />
<TextBlock Style="{StaticResource Glyph}">
&#xed1a;
</TextBlock>
@ -654,7 +661,11 @@
<StackPanel Style="{StaticResource TextPanel}">
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource hideFlowLauncherWhenLoseFocus}" />
</StackPanel>
<CheckBox IsChecked="{Binding Settings.HideWhenDeactive}" Style="{DynamicResource SideControlCheckBox}" />
<ui:ToggleSwitch
Grid.Column="2"
FocusVisualMargin="5"
IsOn="{Binding Settings.HideWhenDeactive}"
Style="{DynamicResource SideToggleSwitch}" />
</ItemsControl>
</Border>
@ -665,7 +676,11 @@
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource hideNotifyIcon}" />
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="{DynamicResource hideNotifyIconToolTip}" />
</StackPanel>
<CheckBox IsChecked="{Binding Settings.HideNotifyIcon}" Style="{DynamicResource SideControlCheckBox}" />
<ui:ToggleSwitch
Grid.Column="2"
FocusVisualMargin="5"
IsOn="{Binding Settings.HideNotifyIcon}"
Style="{DynamicResource SideToggleSwitch}" />
</ItemsControl>
</Border>
@ -697,7 +712,11 @@
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource ignoreHotkeysOnFullscreen}" />
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="{DynamicResource ignoreHotkeysOnFullscreenToolTip}" />
</StackPanel>
<CheckBox IsChecked="{Binding Settings.IgnoreHotkeysOnFullscreen}" Style="{DynamicResource SideControlCheckBox}" />
<ui:ToggleSwitch
Grid.Column="2"
FocusVisualMargin="5"
IsOn="{Binding Settings.IgnoreHotkeysOnFullscreen}"
Style="{DynamicResource SideToggleSwitch}" />
<TextBlock Style="{StaticResource Glyph}">
&#xe7fc;
</TextBlock>
@ -710,9 +729,11 @@
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource ShouldUsePinyin}" />
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="{DynamicResource ShouldUsePinyinToolTip}" />
</StackPanel>
<CheckBox
IsChecked="{Binding Settings.ShouldUsePinyin}"
Style="{DynamicResource SideControlCheckBox}"
<ui:ToggleSwitch
Grid.Column="2"
FocusVisualMargin="5"
IsOn="{Binding Settings.ShouldUsePinyin}"
Style="{DynamicResource SideToggleSwitch}"
ToolTip="{DynamicResource ShouldUsePinyinToolTip}" />
<TextBlock Style="{StaticResource Glyph}">
&#xe98a;
@ -1036,7 +1057,7 @@
VirtualizingStackPanel.VirtualizationMode="Recycling">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Margin="0,0,0,18" />
<VirtualizingStackPanel Margin="0,0,0,0" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
@ -1045,57 +1066,54 @@
x:Name="expanderHeader"
Grid.Column="4"
Padding="0"
Background="Transparent"
FlowDirection="RightToLeft"
BorderThickness="0"
ClipToBounds="True"
IsExpanded="{Binding Mode=TwoWay, Path=IsExpanded}"
SnapsToDevicePixels="True"
Style="{StaticResource ExpanderStyle1}">
<Expander.Header>
<Grid
Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Expander}}, Path=ActualWidth}"
HorizontalAlignment="Left"
FlowDirection="LeftToRight">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" MinWidth="100" />
<ColumnDefinition Width="8*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel
Grid.Column="0"
Margin="24,0,0,0"
VerticalAlignment="Center"
FlowDirection="LeftToRight">
<Image
Width="32"
Height="32"
Margin="32,0,0,0"
FlowDirection="LeftToRight"
Source="{Binding Image, IsAsync=True}" />
</StackPanel>
<StackPanel Grid.Column="1" Margin="12,0,14,0">
<TextBlock
Foreground="{DynamicResource Color05B}"
Text="{Binding PluginPair.Metadata.Name}"
TextWrapping="Wrap"
ToolTip="{Binding PluginPair.Metadata.Version}" />
<TextBlock
Margin="0,2,0,0"
Foreground="{DynamicResource Color04B}"
TextWrapping="WrapWithOverflow">
<Run FontSize="12" Text="{Binding PluginPair.Metadata.Description}" />
</TextBlock>
</StackPanel>
<StackPanel
Grid.Column="2"
HorizontalAlignment="Right"
Orientation="Horizontal">
<TextBlock
Margin="0,0,8,0"
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource Color08B}"
Text="{DynamicResource priority}" />
<Border>
<Border Padding="0,12,0,12">
<Grid Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Expander}}, Path=ActualWidth}" HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="36" MinWidth="36" />
<ColumnDefinition Width="7*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel
Grid.Column="0"
Margin="0,0,0,0"
VerticalAlignment="Center">
<Image
Width="32"
Height="32"
Margin="0,0,0,0"
FlowDirection="LeftToRight"
Source="{Binding Image, IsAsync=True}" />
</StackPanel>
<StackPanel Grid.Column="1" Margin="16,0,14,0">
<TextBlock
Foreground="{DynamicResource Color05B}"
Text="{Binding PluginPair.Metadata.Name}"
TextWrapping="Wrap"
ToolTip="{Binding PluginPair.Metadata.Version}" />
<TextBlock
Margin="0,2,0,0"
Foreground="{DynamicResource Color04B}"
TextWrapping="WrapWithOverflow">
<Run FontSize="12" Text="{Binding PluginPair.Metadata.Description}" />
</TextBlock>
</StackPanel>
<StackPanel
Grid.Column="2"
HorizontalAlignment="Right"
Orientation="Horizontal">
<TextBlock
Margin="0,0,8,0"
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource Color08B}"
Text="{DynamicResource priority}" />
<Button
x:Name="PriorityButton"
Margin="0,0,22,0"
@ -1126,26 +1144,28 @@
</Button.Style>
<!--#endregion-->
</Button>
</Border>
</StackPanel>
<DockPanel Grid.Column="3">
<ui:ToggleSwitch
Margin="0,0,6,0"
HorizontalAlignment="Right"
IsOn="{Binding PluginState}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</DockPanel>
</Grid>
</StackPanel>
<DockPanel Grid.Column="3">
<ui:ToggleSwitch
Margin="0,0,60,0"
HorizontalAlignment="Right"
DockPanel.Dock="Right"
IsOn="{Binding PluginState}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</DockPanel>
</Grid>
</Border>
</Expander.Header>
<Grid FlowDirection="LeftToRight">
<StackPanel Margin="0,12,0,0" Orientation="Vertical">
<StackPanel Margin="0,0,0,0" Orientation="Vertical">
<StackPanel>
<Border
Width="auto"
Width="Auto"
Height="52"
Margin="0"
Padding="0"
BorderThickness="0,1,0,0"
CornerRadius="0"
@ -1170,8 +1190,6 @@
DockPanel.Dock="Left"
Style="{DynamicResource SettingTitleLabel}"
Text="{DynamicResource actionKeywords}" />
<Button
Grid.Column="2"
Width="100"
@ -1186,14 +1204,11 @@
ToolTip="{DynamicResource actionKeywordsTooltip}"
Visibility="{Binding ActionKeywordsVisibility}" />
</DockPanel>
</ItemsControl>
</Border>
</StackPanel>
<StackPanel>
<Border
Padding="0"
HorizontalAlignment="Stretch"
@ -1214,23 +1229,27 @@
</Style.Triggers>
</Style>
</Border.Style>
</Border>
<Border Background="{DynamicResource Color00B}">
<ContentControl
x:Name="PluginSettingControl"
Margin="0"
Padding="1"
VerticalAlignment="Stretch"
Content="{Binding SettingControl}" />
</Border>
<!--#endregion-->
<ContentControl
x:Name="PluginSettingControl"
Margin="0"
Padding="1"
VerticalAlignment="Stretch"
Content="{Binding SettingControl}" />
</StackPanel>
<StackPanel>
<Border
Margin="0"
Padding="0,12,0,0"
Padding="0,12,0,12"
VerticalAlignment="Center"
BorderThickness="0,1,0,0"
CornerRadius="0"
CornerRadius="0 0 5 5"
Style="{DynamicResource SettingGroupBox}">
<ItemsControl Style="{DynamicResource SettingGrid}">
<StackPanel
@ -1317,7 +1336,7 @@
FontSize="11"
Foreground="{DynamicResource PluginInfoColor}"
MouseUp="OnExternalPluginUninstallClick"
Text="{DynamicResource uninstallbtn}"
Text="{DynamicResource plugin_uninstall}"
TextDecorations="Underline" />
<TextBlock
@ -1512,7 +1531,45 @@
<ListView.ItemTemplate>
<DataTemplate>
<!-- Hover Layout Style -->
<DataTemplate.Resources>
<Style x:Key="StoreListItemBtnStyle" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border
x:Name="Background"
Background="{DynamicResource Color00B}"
BorderBrush="{DynamicResource Color03B}"
BorderThickness="1"
CornerRadius="4"
SnapsToDevicePixels="True">
<Border
x:Name="Border"
Padding="{TemplateBinding Padding}"
BorderThickness="1"
CornerRadius="4">
<ContentPresenter
x:Name="ContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Background" Property="Background" Value="{DynamicResource Color07B}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Background" Property="Background" Value="{DynamicResource Color07B}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataTemplate.Resources>
<Button
Name="StoreListItem"
Margin="0"
@ -1523,7 +1580,8 @@
VerticalContentAlignment="Stretch"
BorderThickness="0"
Click="StoreListItem_Click"
FocusVisualStyle="{StaticResource StoreItemFocusVisualStyleKey}">
FocusVisualStyle="{StaticResource StoreItemFocusVisualStyleKey}"
Style="{DynamicResource StoreListItemBtnStyle}">
<ui:FlyoutService.Flyout>
<ui:Flyout x:Name="InstallFlyout" Placement="Bottom">
<Grid MinWidth="200">
@ -2365,11 +2423,10 @@
Text="{DynamicResource showOpenResultHotkey}" />
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="{DynamicResource showOpenResultHotkeyToolTip}" />
</StackPanel>
<CheckBox
<ui:ToggleSwitch
Grid.Column="2"
FontSize="14"
IsChecked="{Binding Settings.ShowOpenResultHotkey}"
Style="{DynamicResource SideControlCheckBox}" />
IsOn="{Binding Settings.ShowOpenResultHotkey}"
Style="{DynamicResource SideToggleSwitch}" />
</ItemsControl>
</Border>
</StackPanel>
@ -2590,7 +2647,10 @@
VerticalAlignment="Center"
Style="{DynamicResource SettingTitleLabel}"
Text="{DynamicResource enableProxy}" />
<CheckBox IsChecked="{Binding Settings.Proxy.Enabled}" Style="{DynamicResource SideControlCheckBox}" />
<ui:ToggleSwitch
Grid.Column="2"
IsOn="{Binding Settings.Proxy.Enabled}"
Style="{DynamicResource SideToggleSwitch}" />
</ItemsControl>
</Border>
<Separator

View file

@ -17,10 +17,14 @@
<system:String x:Key="flowlauncher_plugin_program_suffixes">File Type</system:String>
<system:String x:Key="flowlauncher_plugin_program_reindex">Reindex</system:String>
<system:String x:Key="flowlauncher_plugin_program_indexing">Indexing</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_start">Index Start Menu</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_source">Index Sources</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_option">Options</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_start">Start Menu</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_start_tooltip">When enabled, Flow will load programs from the start menu</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_registry">Index Registry</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_registry">Registry</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_registry_tooltip">When enabled, Flow will load programs from the registry</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_PATH">PATH</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_PATH_tooltip">When enabled, Flow will load programs from the PATH environment variable</system:String>
<system:String x:Key="flowlauncher_plugin_program_enable_hidelnkpath">Hide app path</system:String>
<system:String x:Key="flowlauncher_plugin_program_enable_hidelnkpath_tooltip">For executable files such as UWP or lnk, hide the file path from being visible</system:String>
<system:String x:Key="flowlauncher_plugin_program_enable_description">Search in Program Description</system:String>

View file

@ -95,7 +95,7 @@ namespace Flow.Launcher.Plugin.Program
var b = Task.Run(() =>
{
Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|UWPProgram index cost", IndexUwpPrograms);
Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|UWPPRogram index cost", IndexUwpPrograms);
});
if (cacheEmpty)

View file

@ -273,6 +273,14 @@ namespace Flow.Launcher.Plugin.Program.Programs
program.Valid = false;
return program;
}
catch (FileNotFoundException e)
{
ProgramLogger.LogException($"|Win32|LnkProgram|{path}" +
"|An unexpected error occurred in the calling method LnkProgram", e);
program.Valid = false;
return program;
}
#if !DEBUG //Only do a catch all in production. This is so make developer aware of any unhandled exception and add the exception handling in.
catch (Exception e)
{
@ -343,7 +351,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
}
}
private static IEnumerable<string> ProgramPaths(string directory, string[] suffixes)
private static IEnumerable<string> ProgramPaths(string directory, string[] suffixes, bool recursive = true)
{
if (!Directory.Exists(directory))
return Enumerable.Empty<string>();
@ -351,7 +359,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
return Directory.EnumerateFiles(directory, "*", new EnumerationOptions
{
IgnoreInaccessible = true,
RecurseSubdirectories = true
RecurseSubdirectories = recursive
}).Where(x => suffixes.Contains(Extension(x)));
}
@ -394,7 +402,30 @@ namespace Flow.Launcher.Plugin.Program.Programs
return programs;
}
private static IEnumerable<Win32> AppPathsPrograms(string[] suffixes, string[] protocols)
private static IEnumerable<Win32> PATHPrograms(string[] suffixes)
{
var pathEnv = Environment.GetEnvironmentVariable("Path");
if (String.IsNullOrEmpty(pathEnv))
{
return Array.Empty<Win32>();
}
var paths = pathEnv.Split(";", StringSplitOptions.RemoveEmptyEntries).DistinctBy(p => p.ToLowerInvariant());
var toFilter = paths.AsParallel().SelectMany(p => ProgramPaths(p, suffixes, recursive: false));
var programs = ExceptDisabledSource(toFilter.Distinct())
.Select(x => Extension(x) switch
{
ShortcutExtension => LnkProgram(x),
UrlExtension => UrlProgram(x),
ExeExtension => ExeProgram(x),
_ => Win32Program(x)
});
return programs;
}
private static IEnumerable<Win32> AppPathsPrograms(string[] suffixes)
{
// https://msdn.microsoft.com/en-us/library/windows/desktop/ee872121
const string appPaths = @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths";
@ -552,6 +583,12 @@ namespace Flow.Launcher.Plugin.Program.Programs
autoIndexPrograms = autoIndexPrograms.Concat(startMenu);
}
if (settings.EnablePATHSource)
{
var path = PATHPrograms(settings.GetSuffixes());
autoIndexPrograms = autoIndexPrograms.Concat(path);
}
autoIndexPrograms = ProgramsHasher(autoIndexPrograms);
return programs.Concat(autoIndexPrograms).Where(x => x.Valid).Distinct().ToArray();

View file

@ -118,6 +118,8 @@ namespace Flow.Launcher.Plugin.Program
public bool EnableDescription { get; set; } = false;
public bool HideAppsPath { get; set; } = true;
public bool EnableRegistrySource { get; set; } = true;
public bool EnablePATHSource { get; set; } = true;
public string CustomizedExplorer { get; set; } = Explorer;
public string CustomizedArgs { get; set; } = ExplorerArgs;

View file

@ -10,58 +10,88 @@
mc:Ignorable="d">
<Grid Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="170" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="60" />
</Grid.RowDefinitions>
<DockPanel
Margin="70,10,0,8"
HorizontalAlignment="Stretch"
LastChildFill="True">
<TextBlock
MinWidth="120"
Margin="0,5,10,0"
Text="{DynamicResource flowlauncher_plugin_program_index_source}" />
<WrapPanel
Width="Auto"
Margin="0,0,14,0"
HorizontalAlignment="Right"
DockPanel.Dock="Right">
<CheckBox
Name="StartMenuEnabled"
Margin="12,0,12,0"
Content="{DynamicResource flowlauncher_plugin_program_index_start}"
IsChecked="{Binding EnableStartMenuSource}"
ToolTip="{DynamicResource flowlauncher_plugin_program_index_start_tooltip}" />
<CheckBox
Name="RegistryEnabled"
Margin="12,0,12,0"
Content="{DynamicResource flowlauncher_plugin_program_index_registry}"
IsChecked="{Binding EnableRegistrySource}"
ToolTip="{DynamicResource flowlauncher_plugin_program_index_registry_tooltip}" />
<CheckBox
Name="PATHEnabled"
Margin="12,0,12,0"
Content="{DynamicResource flowlauncher_plugin_program_index_PATH}"
IsChecked="{Binding EnablePATHSource}"
ToolTip="{DynamicResource flowlauncher_plugin_program_index_PATH_tooltip}" />
</WrapPanel>
</DockPanel>
<StackPanel
Grid.Row="0"
Grid.Row="1"
HorizontalAlignment="Stretch"
Orientation="Vertical">
<StackPanel Width="Auto" Orientation="Vertical">
<StackPanel Width="Auto" Orientation="Horizontal">
<CheckBox
Name="StartMenuEnabled"
Width="220"
Margin="70,8,10,8"
Content="{DynamicResource flowlauncher_plugin_program_index_start}"
IsChecked="{Binding EnableStartMenuSource}"
ToolTip="{DynamicResource flowlauncher_plugin_program_index_start_tooltip}" />
<CheckBox
Name="RegistryEnabled"
Margin="70,8,10,8"
Content="{DynamicResource flowlauncher_plugin_program_index_registry}"
IsChecked="{Binding EnableRegistrySource}"
ToolTip="{DynamicResource flowlauncher_plugin_program_index_registry_tooltip}" />
</StackPanel>
<Separator
Height="1"
BorderBrush="{DynamicResource Color03B}"
BorderThickness="1" />
<StackPanel Width="Auto" Orientation="Horizontal">
<Separator
Height="1"
BorderBrush="{DynamicResource Color03B}"
BorderThickness="1" />
<DockPanel
Margin="70,10,0,8"
HorizontalAlignment="Stretch"
LastChildFill="True">
<TextBlock
MinWidth="120"
Margin="0,5,10,0"
Text="{DynamicResource flowlauncher_plugin_program_index_option}" />
<WrapPanel
Width="Auto"
Margin="0,0,14,0"
HorizontalAlignment="Right"
DockPanel.Dock="Right">
<CheckBox
Name="HideLnkEnabled"
Width="220"
Margin="70,8,10,8"
Margin="12,0,12,0"
Content="{DynamicResource flowlauncher_plugin_program_enable_hidelnkpath}"
IsChecked="{Binding HideAppsPath}"
ToolTip="{DynamicResource flowlauncher_plugin_program_enable_hidelnkpath_tooltip}" />
<CheckBox
Name="DescriptionEnabled"
Margin="70,8,10,8"
Margin="12,0,12,0"
Content="{DynamicResource flowlauncher_plugin_program_enable_description}"
IsChecked="{Binding EnableDescription}"
ToolTip="{DynamicResource flowlauncher_plugin_program_enable_description_tooltip}" />
</StackPanel>
<Separator
Height="1"
BorderBrush="{DynamicResource Color03B}"
BorderThickness="1" />
</StackPanel>
</WrapPanel>
</DockPanel>
<Separator
Height="1"
BorderBrush="{DynamicResource Color03B}"
BorderThickness="1" />
<StackPanel
Width="Auto"
Margin="10,6,0,0"
Margin="60,6,0,0"
HorizontalAlignment="Left"
Orientation="Horizontal">
<Button
@ -107,8 +137,8 @@
</StackPanel>
<ListView
x:Name="programSourceView"
Grid.Row="1"
Margin="20,0,20,0"
Grid.Row="2"
Margin="70,0,20,0"
AllowDrop="True"
BorderBrush="DarkGray"
BorderThickness="1"
@ -149,7 +179,7 @@
</ListView.View>
</ListView>
<DockPanel
Grid.Row="2"
Grid.Row="3"
Grid.RowSpan="1"
Margin="0,0,20,10">
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
@ -175,66 +205,3 @@
</DockPanel>
</Grid>
</UserControl>

View file

@ -66,6 +66,16 @@ namespace Flow.Launcher.Plugin.Program.Views
}
}
public bool EnablePATHSource
{
get => _settings.EnablePATHSource;
set
{
_settings.EnablePATHSource = value;
ReIndexing();
}
}
public string CustomizedExplorerPath
{
get => _settings.CustomizedExplorer;