[PTRun]Fluent UX and switch to WpfUI (#28538)

* New design

* Updating icons

* Adding keywords

* Only show plugins when search query is empty

* Update App.xaml

* Update App.xaml

* Filter plugins

* Fix image name

* refresh plugins overview

* fix context menu icons in win10

* Remove unused animations

* Resolving crashing

* Fix focus visual and a11y

* Remove unused styles

* Revert "Remove unused styles"

This reverts commit 65f29ae6ed.

* Fix value generator light vs dark icon

* Fix tab characters

* Fix CI

* Update SettingsReader.cs

* Adding common OS check helper

* Update MainWindow.xaml.cs

* Fix background

* More tweaks

* XAML styler and updating legacy brushes

* Updates + xaml styling

* Fix CI

* Fix CI2

* fix font family and overview refresh

* Delete shutdown.light-1.png

* Updating icons

* Set DPI

---------

Co-authored-by: Davide Giacometti <davide.giacometti@outlook.it>
This commit is contained in:
Niels Laute
2023-11-20 11:23:26 +01:00
committed by GitHub
parent 67b18d0e98
commit c095cdde4e
131 changed files with 772 additions and 745 deletions

View File

@@ -1,17 +1,18 @@
<Application x:Class="PowerLauncher.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:theming="clr-namespace:Common.UI;assembly=PowerToys.Common.UI"
xmlns:ui="http://schemas.modernwpf.com/2019"
ShutdownMode="OnMainWindowClose"
Startup="OnStartup">
<Application
x:Class="PowerLauncher.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:theming="clr-namespace:Common.UI;assembly=PowerToys.Common.UI"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
ShutdownMode="OnMainWindowClose"
Startup="OnStartup">
<Application.Resources>
<ResourceDictionary>
<theming:CustomLibraryThemeProvider x:Key="{x:Static theming:CustomLibraryThemeProvider.DefaultInstance}" />
<ResourceDictionary.MergedDictionaries>
<ui:ThemeResources />
<ui:XamlControlsResources />
<ResourceDictionary Source="pack://application:,,,/Themes/Dark.xaml" />
<ui:ThemesDictionary Theme="Dark" />
<ui:ControlsDictionary />
<ResourceDictionary Source="pack://application:,,,/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>

View File

@@ -141,6 +141,9 @@ namespace PowerLauncher
PluginManager.InitializePlugins(API);
_mainVM.RefreshPluginsOverview();
_settingsReader.SetRefreshPluginsOverviewCallback(() => _mainVM.RefreshPluginsOverview());
Current.MainWindow = _mainWindow;
Current.MainWindow.Title = Constant.ExeFileName;

View File

@@ -2,99 +2,93 @@
x:Class="PowerLauncher.LauncherControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:p="clr-namespace:PowerLauncher.Properties"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:PowerLauncher"
xmlns:ui="http://schemas.modernwpf.com/2019"
mc:Ignorable="d"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:p="clr-namespace:PowerLauncher.Properties"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
d:DesignHeight="300"
d:DesignWidth="720">
d:DesignWidth="720"
mc:Ignorable="d">
<UserControl.Resources>
<Style x:Key="QueryTextBoxStyle" TargetType="{x:Type TextBox}">
<Style
x:Key="QueryTextBoxStyle"
BasedOn="{StaticResource DefaultTextBoxStyle}"
TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Foreground" Value="{DynamicResource ControlTextBrushKey}"/>
<Setter Property="CaretBrush" Value="{DynamicResource ControlTextBrushKey}"/>
<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="AllowDrop" Value="true"/>
<Setter Property="ContextMenu" Value="{DynamicResource TextControlContextMenu}" />
<Setter Property="ui:TextContextMenu.UsingTextContextMenu" Value="True" />
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
<Setter Property="Padding" Value="12,0,0,0" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="CaretBrush" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="AllowDrop" Value="true" />
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
<Setter Property="Padding" Value="5,0,0,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Grid>
<TextBlock Margin="14, 0, 0, 0"
Text="{TemplateBinding Tag}">
<TextBlock
Margin="6,0,0,0"
VerticalAlignment="Center"
FontSize="16"
Text="{TemplateBinding Tag}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="Transparent"/>
<Setter Property="Foreground" Value="Transparent" />
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Text, RelativeSource={RelativeSource TemplatedParent}}" Value="">
<Setter Property="Foreground" Value="{DynamicResource TextControlPlaceholderForeground}"/>
<Setter Property="Foreground" Value="{DynamicResource TextPlaceholderColorBrush}" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<Border x:Name="border"
<Border
x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="True">
<ScrollViewer
x:Name="PART_ContentHost"
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
SnapsToDevicePixels="True">
<ScrollViewer x:Name="PART_ContentHost"
Background="{TemplateBinding Background}"
Focusable="false"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden">
Focusable="false"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden">
<ScrollViewer.ContentTemplate>
<DataTemplate>
<Grid
Background="{Binding Background, ElementName=PART_ContentHost}">
<ContentPresenter Content="{Binding Path=Content, ElementName=PART_ContentHost}"/>
<Grid Background="{Binding Background, ElementName=PART_ContentHost}">
<ContentPresenter Content="{Binding Path=Content, ElementName=PART_ContentHost}" />
</Grid>
</DataTemplate>
</ScrollViewer.ContentTemplate>
</ScrollViewer>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.56"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.MouseOver.Border}"/>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.Focus.Border}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsInactiveSelectionHighlightEnabled" Value="true"/>
<Condition Property="IsSelectionActive" Value="false"/>
<Condition Property="IsInactiveSelectionHighlightEnabled" Value="true" />
<Condition Property="IsSelectionActive" Value="false" />
</MultiTrigger.Conditions>
<Setter Property="SelectionBrush" Value="{DynamicResource InactiveSelectionHighlightBrushKey}"/>
<Setter Property="SelectionBrush" Value="{DynamicResource TextOnAccentFillColorSelectedTextBrush}" />
</MultiTrigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
<Grid
Height="68"
<Grid
MinHeight="32"
Margin="12"
VerticalAlignment="Top">
<!--Background="{ThemeResource BackdropAcrylicBrush}"-->
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="72"/>
<ColumnDefinition Width="32" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!--
@@ -102,36 +96,28 @@
https://stackoverflow.com/questions/11873378/adding-placeholder-text-to-textbox
-->
<local:CustomSearchBox
AutomationProperties.Name="{x:Static p:Resources.Query}"
x:Name="QueryTextBox"
x:FieldModifier="public"
Canvas.ZIndex="0"
Margin="10, 0, 0, 0"
Grid.Column="1"
VerticalAlignment="Center"
FontSize="24"
x:FieldModifier="public"
AutomationProperties.Name="{x:Static p:Resources.Query}"
Canvas.ZIndex="0"
FontSize="18"
Style="{StaticResource QueryTextBoxStyle}"
Tag="{x:Static p:Resources.startTyping}"
/>
Tag="{x:Static p:Resources.startTyping}" />
<TextBlock
x:Name="AutoCompleteTextBlock"
x:FieldModifier="public"
Opacity="0.6"
Canvas.ZIndex="-1"
Margin="24, 0, 14, 0"
VerticalAlignment="Center"
FontSize="24"
Foreground="{DynamicResource TextControlPlaceholderForeground}"
Background="{DynamicResource SystemChromeLow}"
/>
<TextBlock
AutomationProperties.Name="{x:Static p:Resources.SearchIcon}"
Grid.Column="1"
Text="&#xE721;"
FontFamily="Segoe MDL2 Assets"
FontSize="26"
HorizontalAlignment="Center"
Margin="7,0,14,0"
VerticalAlignment="Center"
Foreground="{DynamicResource TextControlPlaceholderForeground}"
SnapsToDevicePixels="True"/>
x:FieldModifier="public"
Canvas.ZIndex="-1"
FontSize="18"
Foreground="{DynamicResource TextPlaceholderColorBrush}" />
<ui:SymbolIcon
AutomationProperties.Name="{x:Static p:Resources.SearchIcon}"
FontSize="18"
Foreground="{DynamicResource TextPlaceholderColorBrush}"
Symbol="Search12" />
</Grid>
</UserControl>

View File

@@ -1,119 +1,123 @@
<Window x:Class="PowerLauncher.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:PowerLauncher.ViewModel"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PowerLauncher"
mc:Ignorable="d"
Title="PowerToys Run"
Topmost="True"
SizeToContent="Height"
ResizeMode="NoResize"
WindowStyle="None"
WindowStartupLocation="Manual"
AllowDrop="True"
ShowInTaskbar="False"
AllowsTransparency="True"
SourceInitialized="OnSourceInitialized"
Loaded="OnLoaded"
Closing="OnClosing"
Closed="OnClosed"
Background="Transparent"
LocationChanged="OnLocationChanged"
Deactivated="OnDeactivated"
IsVisibleChanged="OnVisibilityChanged"
Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
d:DataContext="{d:DesignInstance vm:MainViewModel}">
<Window.Resources>
<CubicEase x:Key="CubicEaseOut" EasingMode="EaseOut"/>
<!-- Some of the durations are different to give a 'parallax' feel (like start menu has as well) -->
<!--<Storyboard x:Key="IntroStoryboard">
<DoubleAnimation From="20" To="0" Duration="0:0:0.2" Storyboard.TargetName="SearchBoxBorder" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" EasingFunction="{StaticResource CubicEaseOut}"/>
<DoubleAnimation From="20" To="0" Duration="0:0:0.250" Storyboard.TargetName="SearchBox" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" EasingFunction="{StaticResource CubicEaseOut}"/>
<DoubleAnimation From="0.5" To="1" Duration="0:0:0.150" Storyboard.TargetName="SearchBoxBorder" Storyboard.TargetProperty="(UIElement.Opacity)" EasingFunction="{StaticResource CubicEaseOut}"/>
<DoubleAnimation From="-10" To="0" Duration="0:0:0.2" Storyboard.TargetName="ListBoxBorder" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" EasingFunction="{StaticResource CubicEaseOut}"/>
<DoubleAnimation From="0.5" To="1" Duration="0:0:0.1" Storyboard.TargetName="ListBoxBorder" Storyboard.TargetProperty="(UIElement.Opacity)" EasingFunction="{StaticResource CubicEaseOut}"/>
</Storyboard>-->
<ui:FluentWindow
x:Class="PowerLauncher.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:PowerLauncher"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:p="clr-namespace:PowerLauncher.Properties"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:vm="clr-namespace:PowerLauncher.ViewModel"
Title="PowerToys Run"
Width="640"
d:DataContext="{d:DesignInstance vm:MainViewModel}"
ui:ExtendsContentIntoTitleBar="True"
AllowDrop="True"
Closed="OnClosed"
Closing="OnClosing"
Deactivated="OnDeactivated"
IsVisibleChanged="OnVisibilityChanged"
Loaded="OnLoaded"
LocationChanged="OnLocationChanged"
ResizeMode="NoResize"
ShowInTaskbar="False"
SizeToContent="Height"
SourceInitialized="OnSourceInitialized"
Topmost="True"
Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
WindowStartupLocation="Manual"
WindowStyle="None"
mc:Ignorable="d">
<!-- Duration is a bit shorter, since it's an outro animation and you want it to be gone asap -->
<!--<Storyboard x:Key="OutroStoryboard" Completed="OutroStoryboard_Completed">
<DoubleAnimation From="0" To="20" Duration="0:0:0.18" Storyboard.TargetName="SearchBoxBorder" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" EasingFunction="{StaticResource CubicEaseOut}"/>
<DoubleAnimation From="1" To="0.0" Duration="0:0:0.18" Storyboard.TargetName="SearchBoxBorder" Storyboard.TargetProperty="(UIElement.Opacity)" EasingFunction="{StaticResource CubicEaseOut}"/>
<DoubleAnimation From="0" To="-10" Duration="0:0:0.18" Storyboard.TargetName="ListBoxBorder" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" EasingFunction="{StaticResource CubicEaseOut}"/>
<DoubleAnimation From="1" To="0.0" Duration="0:0:0.18" Storyboard.TargetName="ListBoxBorder" Storyboard.TargetProperty="(UIElement.Opacity)" EasingFunction="{StaticResource CubicEaseOut}"/>
</Storyboard>-->
</Window.Resources>
<Grid Width="720"
MouseDown="OnMouseDown">
<Grid x:Name="RootGrid" MouseDown="OnMouseDown">
<!-- We set the background here because the Acrylic can be too translucent / background too bright on Light theme -->
<Grid.Background>
<SolidColorBrush Opacity="0.8" Color="{DynamicResource ApplicationBackgroundColor}" />
</Grid.Background>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" MaxHeight="{Binding Results.MaxHeight}" />
</Grid.RowDefinitions>
<Grid
x:Name="SearchBoxBorder"
Grid.Row="0"
Margin="24,24,24,24">
<Rectangle
Fill="{DynamicResource SystemChromeLow}"
RadiusX="4"
RadiusY="4"
Stroke="{DynamicResource DialogBorderBrush}"
StrokeThickness="1">
<Rectangle.Effect>
<DropShadowEffect BlurRadius="32" Opacity="0.28" ShadowDepth="1" />
</Rectangle.Effect>
</Rectangle>
<local:LauncherControl
x:Name="SearchBox">
<!--<local:LauncherControl.RenderTransform>
<TranslateTransform />
</local:LauncherControl.RenderTransform>-->
</local:LauncherControl>
<!--<Border.RenderTransform>
<TranslateTransform />
</Border.RenderTransform>-->
</Grid>
<Grid
x:Name="ListBoxBorder"
<Border
x:Name="SearchBoxBorder"
Grid.Row="0"
Margin="12,12,12,0"
Background="{DynamicResource LayerFillColorDefaultBrush}"
BorderBrush="{DynamicResource SurfaceStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="8">
<local:LauncherControl x:Name="SearchBox" />
</Border>
<local:ResultList
x:Name="ListBox"
Grid.Row="1"
Margin="24,-8,24,24"
Visibility="{Binding Results.Visibility}">
<!--<Border.RenderTransform>
<TranslateTransform />
</Border.RenderTransform>-->
<Rectangle
RadiusX="4"
RadiusY="4"
Fill="{DynamicResource SystemChromeLow}"
Stroke="{DynamicResource DialogBorderBrush}"
StrokeThickness="1">
<Rectangle.Effect>
<DropShadowEffect BlurRadius="32" Opacity="0.28" ShadowDepth="1" />
</Rectangle.Effect>
</Rectangle>
<local:ResultList x:Name="ListBox"
PreviewMouseDown="ListBox_PreviewMouseDown" >
<!--<local:ResultList.RenderTransform>
<TranslateTransform />
</local:ResultList.RenderTransform>-->
</local:ResultList>
<Rectangle
RadiusX="4"
RadiusY="4"
Stroke="{DynamicResource DialogBorderBrush}"
StrokeThickness="1" />
VerticalAlignment="Stretch"
PreviewMouseDown="ListBox_PreviewMouseDown"
Visibility="{Binding Results.Visibility}" />
<!-- Have to use a Grid instead of a StackPanel for scrolling to work? -->
<Grid
x:Name="KeywordsOverviewGrid"
Grid.Row="1"
Margin="12,0,0,0"
Visibility="{Binding PluginsOverviewVisibility}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock
Margin="10,16,0,8"
FontWeight="SemiBold"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{x:Static p:Resources.PluginKeywords}" />
<ListView
Grid.Row="1"
ItemContainerStyle="{StaticResource PluginsListViewItemStyle}"
ItemsSource="{Binding Plugins}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto"
SelectionMode="Single">
<ListView.ItemTemplate>
<DataTemplate>
<Grid Height="36">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border
Width="32"
Height="32"
Margin="4,0,10,0"
Background="{DynamicResource ControlFillColorDefaultBrush}"
BorderBrush="{DynamicResource CardStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="4">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontWeight="SemiBold"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="{Binding Metadata.ActionKeyword}" />
</Border>
<TextBlock
Grid.Column="1"
VerticalAlignment="Center"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{Binding Plugin.Description}"
TextTrimming="CharacterEllipsis" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</Grid>
<Window.InputBindings>
<KeyBinding Key="Escape"
Command="{Binding EscCommand}" />
<KeyBinding Key="Enter"
Command="{Binding OpenResultWithKeyboardCommand}" />
<KeyBinding Modifiers="Alt"
Key="F4"
Command="{Binding IgnoreCommand}" />
</Window.InputBindings>
</Window>
</Grid>
<ui:FluentWindow.InputBindings>
<KeyBinding Key="Escape" Command="{Binding EscCommand}" />
<KeyBinding Key="Enter" Command="{Binding OpenResultWithKeyboardCommand}" />
<KeyBinding
Key="F4"
Command="{Binding IgnoreCommand}"
Modifiers="Alt" />
</ui:FluentWindow.InputBindings>
</ui:FluentWindow>

View File

@@ -54,9 +54,19 @@ namespace PowerLauncher
_viewModel = mainVM;
_nativeWaiterCancelToken = nativeWaiterCancelToken;
_settings = settings;
InitializeComponent();
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this);
if (OSVersionHelper.IsWindows11())
{
WindowBackdropType = Wpf.Ui.Controls.WindowBackdropType.Acrylic;
}
else
{
WindowBackdropType = Wpf.Ui.Controls.WindowBackdropType.None;
}
_firstDeleteTimer.Elapsed += CheckForFirstDelete;
_firstDeleteTimer.Interval = 1000;
NativeEventWaiter.WaitForEventLoop(
@@ -395,7 +405,6 @@ namespace PowerLauncher
{
if (_settings.HideWhenDeactivated)
{
// (this.FindResource("OutroStoryboard") as Storyboard).Begin();
_viewModel.Hide();
}
}
@@ -726,11 +735,6 @@ namespace PowerLauncher
}
}
private void OutroStoryboard_Completed(object sender, EventArgs e)
{
Hide();
}
private void SearchBox_UpdateFlowDirection()
{
SearchBox.QueryTextBox.FlowDirection = MainViewModel.GetLanguageFlowDirection();

View File

@@ -86,6 +86,7 @@
<PackageReference Include="System.Data.OleDb" />
<PackageReference Include="System.ServiceProcess.ServiceController" />
<PackageReference Include="UnitsNet" />
<PackageReference Include="WPF-UI" />
<!-- HACK: Microsoft.Extensions.Hosting is referenced, even if it is not used, to force dll versions to be the same as in other projects. Really only needed since OneNote uses the LazyCache and NLog dependencies, which references older assemblies. -->
<PackageReference Include="Microsoft.Extensions.Hosting" />
</ItemGroup>

View File

@@ -1,4 +1,4 @@
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
@@ -19,7 +19,7 @@ namespace PowerLauncher.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Resources {
@@ -168,6 +168,15 @@ namespace PowerLauncher.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Plugin keywords.
/// </summary>
public static string PluginKeywords {
get {
return ResourceManager.GetString("PluginKeywords", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Query.
/// </summary>

View File

@@ -194,4 +194,7 @@
<data name="ContextMenuItemsAvailable" xml:space="preserve">
<value>Appended controls available</value>
</data>
<data name="PluginKeywords" xml:space="preserve">
<value>Plugin keywords</value>
</data>
</root>

View File

@@ -1,72 +1,74 @@
<Window x:Class="PowerLauncher.ReportWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:p="clr-namespace:PowerLauncher.Properties"
xmlns:ui="http://schemas.modernwpf.com/2019"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
Background="{DynamicResource SystemChromeLow}"
Topmost="True"
ui:WindowHelper.UseModernWindowStyle="True"
ResizeMode="NoResize"
Width="760"
Height="560"
Title="{x:Static p:Resources.reportWindow_wox_got_an_error}"
d:DesignHeight="300"
d:DesignWidth="600"
x:ClassModifier="internal">
<Window
x:Class="PowerLauncher.ReportWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:p="clr-namespace:PowerLauncher.Properties"
Title="{x:Static p:Resources.reportWindow_wox_got_an_error}"
Width="760"
Height="560"
d:DesignHeight="300"
d:DesignWidth="600"
x:ClassModifier="internal"
ResizeMode="NoResize"
Topmost="True"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<Grid Margin="12">
<Grid.RowDefinitions>
<RowDefinition Height="64"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="64" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="{x:Static p:Resources.reportWindow_header}"
FontFamily="Segoe UI Light"
FontSize="32"
Foreground="{DynamicResource ControlTextBrushKey}"/>
<TextBlock FontSize="14"
Grid.Row="1"
TextWrapping="Wrap"
Foreground="{DynamicResource ControlTextBrushKey}">
<Run Text="{x:Static p:Resources.reportWindow_file_bug}"/>
<Hyperlink x:Name="RepositoryHyperlink"
Click="RepositoryHyperlink_Click"
FontWeight="SemiBold"
NavigateUri="https://aka.ms/powerToysReportBug">
<Run Text="{x:Static p:Resources.reportWindow_github_repo}"/>
</Hyperlink>
<Run Text="{x:Static p:Resources.reportWindow_period}"/>
<Run Text="{x:Static p:Resources.reportWindow_upload_log}"/>
</TextBlock>
<TextBox Background="Transparent"
BorderThickness="0"
Grid.Row="2"
x:Name="LogFilePathBox"
Margin="-8,16,-8,16"
FontSize="14"
FontFamily="Consolas"
Foreground="{DynamicResource ControlTextBrushKey}"
IsReadOnly="True"
TextWrapping="Wrap"/>
<TextBlock
FontFamily="Segoe UI Light"
FontSize="32"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="{x:Static p:Resources.reportWindow_header}" />
<RichTextBox x:Name="ErrorTextbox"
Grid.Row="3"
BorderThickness="1"
Background="Transparent"
IsDocumentEnabled="True"
Foreground="{DynamicResource ControlTextBrushKey}"
VerticalAlignment="Stretch"
FontFamily="Consolas"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Auto"
FontSize="14"/>
<TextBlock
Grid.Row="1"
FontSize="14"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
TextWrapping="Wrap">
<Run Text="{x:Static p:Resources.reportWindow_file_bug}" />
<Hyperlink
x:Name="RepositoryHyperlink"
Click="RepositoryHyperlink_Click"
FontWeight="SemiBold"
NavigateUri="https://aka.ms/powerToysReportBug">
<Run Text="{x:Static p:Resources.reportWindow_github_repo}" />
</Hyperlink>
<Run Text="{x:Static p:Resources.reportWindow_period}" />
<Run Text="{x:Static p:Resources.reportWindow_upload_log}" />
</TextBlock>
<TextBox
x:Name="LogFilePathBox"
Grid.Row="2"
Margin="-8,16,-8,16"
Background="Transparent"
BorderThickness="0"
FontFamily="Consolas"
FontSize="14"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
IsReadOnly="True"
TextWrapping="Wrap" />
<RichTextBox
x:Name="ErrorTextbox"
Grid.Row="3"
VerticalAlignment="Stretch"
Background="Transparent"
BorderThickness="1"
FontFamily="Consolas"
FontSize="14"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
HorizontalScrollBarVisibility="Auto"
IsDocumentEnabled="True"
VerticalScrollBarVisibility="Auto" />
</Grid>
</Window>

View File

@@ -2,317 +2,206 @@
x:Class="PowerLauncher.ResultList"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:converters="clr-namespace:PowerLauncher.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:helper="clr-namespace:PowerLauncher.Helper"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:p="clr-namespace:PowerLauncher.Properties"
xmlns:helper="clr-namespace:PowerLauncher.Helper"
xmlns:converters="clr-namespace:PowerLauncher.Converters"
xmlns:viewmodel="clr-namespace:PowerLauncher.ViewModel"
mc:Ignorable="d"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:viewmodel="clr-namespace:PowerLauncher.ViewModel"
d:DesignHeight="300"
d:DesignWidth="720">
d:DesignWidth="720"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<converters:HighlightTextConverter x:Key="highlightTextConverter" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<Style x:Key="FocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2"
StrokeDashArray="1 2"
SnapsToDevicePixels="true"
StrokeThickness="1"
Stroke="{DynamicResource ControlTextBrushKey}"/>
<Rectangle
Margin="2"
SnapsToDevicePixels="true"
Stroke="{DynamicResource FocusStrokeColorOuterBrush}"
StrokeDashArray="1 2"
StrokeThickness="1" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="IconButtonStyle" TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
<Setter Property="Foreground" Value="{DynamicResource ControlTextBrushKey}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="border"
CornerRadius="4"
Background="Transparent"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="Transparent"
SnapsToDevicePixels="true">
<ContentPresenter x:Name="contentPresenter"
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsDefaulted" Value="true">
<Setter Property="Background" TargetName="border" Value="Transparent"/>
<Setter Property="BorderBrush" TargetName="border" Value="Transparent"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="border" Value="{DynamicResource ButtonBackgroundPointerOver}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ButtonBorderPointerOver}"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="border" Value="{DynamicResource ButtonBackgroundPressed}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ButtonBorderPressed}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<!--<Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>-->
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ResultsListViewItemContainerStyle" TargetType="ListViewItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource ControlTextBrushKey}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Grid Background="Transparent">
<Border x:Name="HighlightBorder"
BorderThickness="0"
CornerRadius="4"
Background="{DynamicResource SystemChromeLow}"
BorderBrush="Transparent"
SnapsToDevicePixels="true"/>
<ContentPresenter x:Name="contentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}" RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" TargetName="HighlightBorder" Value="{DynamicResource ListViewItemBackgroundPointerOver}"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" TargetName="HighlightBorder" Value="{DynamicResource SystemControlHighlightListAccentLowBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Focusable" Value="False" />
</Style>
<Style x:Key="CommandButtonListViewItemContainerStyle" TargetType="ListViewItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Border x:Name="border"
CornerRadius="4"
Background="Transparent"
BorderBrush="Transparent"
SnapsToDevicePixels="true">
<ContentPresenter x:Name="contentPresenter"
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="border" Value="Transparent"/>
<Setter Property="BorderBrush" TargetName="border" Value="Transparent"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" TargetName="border" Value="{DynamicResource ButtonBackgroundPressed}"/>
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ButtonBorderPressed}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CollapsableTextblock"
TargetType="TextBlock">
<Style
x:Key="CollapsableTextblock"
BasedOn="{StaticResource CaptionTextBlockStyle}"
TargetType="TextBlock">
<Style.Triggers>
<Trigger Property="Text"
Value="">
<Setter Property="Visibility"
Value="Collapsed" />
<Trigger Property="Text" Value="">
<Setter Property="Visibility" Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid VerticalAlignment="Top">
<ListView
x:Name="SuggestionsList"
x:FieldModifier="public"
Background="Transparent"
BorderThickness="0"
MaxHeight="{Binding Results.MaxHeight}"
Margin="0"
ItemsSource="{Binding Results.Results, Mode=OneWay}"
Padding="0, 0"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto"
SelectionMode="Single"
SelectedIndex="{Binding Results.SelectedIndex, Mode=TwoWay}"
SelectionChanged="SuggestionsListView_SelectionChanged"
ItemContainerStyle="{StaticResource ResultsListViewItemContainerStyle}"
AutomationProperties.Name="{x:Static p:Resources.Results}">
<!--AllowFocusOnInteraction="False"
IsItemClickEnabled="True"-->
<!--Style="{StaticResource ListViewNoAnimations}"-->
<ListView.ItemTemplate>
<DataTemplate>
<Grid
Height="72"
Width="642"
<ListView
x:Name="SuggestionsList"
Margin="0,12,0,0"
x:FieldModifier="public"
AutomationProperties.Name="{x:Static p:Resources.Results}"
ItemsSource="{Binding Results.Results, Mode=OneWay}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto"
SelectedIndex="{Binding Results.SelectedIndex, Mode=TwoWay}"
SelectionChanged="SuggestionsListView_SelectionChanged"
SelectionMode="Single">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel
Margin="12,6,0,0"
IsVirtualizing="{TemplateBinding VirtualizingPanel.IsVirtualizing}"
VirtualizationMode="{TemplateBinding VirtualizingPanel.VirtualizationMode}" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<!--
AllowFocusOnInteraction="False"
IsItemClickEnabled="True"
-->
<!-- Style="{StaticResource ListViewNoAnimations}" -->
<ListView.ItemTemplate>
<DataTemplate>
<Grid
Height="40"
Background="Transparent"
ToolTipService.BetweenShowDelay="0"
ToolTipService.InitialShowDelay="1000">
<Behaviors:Interaction.Triggers>
<Behaviors:EventTrigger EventName="MouseEnter">
<Behaviors:InvokeCommandAction Command="{Binding ActivateContextButtonsHoverCommand}" />
</Behaviors:EventTrigger>
<Behaviors:EventTrigger EventName="MouseLeave">
<Behaviors:InvokeCommandAction Command="{Binding DeactivateContextButtonsHoverCommand}" />
</Behaviors:EventTrigger>
</Behaviors:Interaction.Triggers>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ToolTip>
<ToolTip Opened="ToolTip_Opened" Visibility="{Binding Result.ToolTipVisibility}">
<StackPanel>
<TextBlock
FontWeight="Bold"
Style="{DynamicResource CollapsableTextblock}"
Text="{Binding Result.ToolTipData.Title}"
TextWrapping="Wrap" />
<TextBlock
Margin="0,4,0,0"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Style="{DynamicResource CollapsableTextblock}"
Text="{Binding Result.ToolTipData.Text}"
TextWrapping="Wrap" />
</StackPanel>
</ToolTip>
</Grid.ToolTip>
<Image
x:Name="AppIcon"
Grid.RowSpan="2"
Height="24"
MaxWidth="56"
Margin="-6,-2,0,0"
HorizontalAlignment="Center"
AutomationProperties.Name="{x:Static p:Resources.AppIcon}"
Source="{Binding Image}" />
<TextBlock
x:Name="Title"
Grid.Column="1"
VerticalAlignment="Bottom"
AutomationProperties.Name="{x:Static p:Resources.Title}"
FontSize="14"
IsHitTestVisible="False"
TextTrimming="CharacterEllipsis">
<viewmodel:ResultsViewModel.FormattedText>
<MultiBinding Converter="{StaticResource highlightTextConverter}">
<Binding Path="Result.Title" />
<Binding Path="Result.TitleHighlightData" />
<Binding Path="IsSelected" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type ListViewItem}}" />
</MultiBinding>
</viewmodel:ResultsViewModel.FormattedText>
</TextBlock>
<TextBlock
x:Name="Path"
Grid.Row="1"
Grid.Column="1"
Margin="0,0,0,0"
VerticalAlignment="Top"
AutomationProperties.Name="{x:Static p:Resources.Subtitle}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{Binding Result.SubTitle}"
TextTrimming="CharacterEllipsis" />
<ListView
Grid.RowSpan="2"
Grid.Column="2"
HorizontalAlignment="Right"
VerticalAlignment="Center"
AutomationProperties.Name="{x:Static p:Resources.ContextMenuItemsCollection}"
Background="Transparent"
ToolTipService.BetweenShowDelay="0"
ToolTipService.InitialShowDelay="1000">
<Behaviors:Interaction.Triggers>
<Behaviors:EventTrigger EventName="MouseEnter">
<Behaviors:InvokeCommandAction Command="{Binding ActivateContextButtonsHoverCommand}"/>
</Behaviors:EventTrigger>
<Behaviors:EventTrigger EventName="MouseLeave">
<Behaviors:InvokeCommandAction Command="{Binding DeactivateContextButtonsHoverCommand}"/>
</Behaviors:EventTrigger>
</Behaviors:Interaction.Triggers>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="64" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions >
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ToolTip>
<ToolTip Visibility="{Binding Result.ToolTipVisibility}" Opened="ToolTip_Opened">
<StackPanel>
<TextBlock
Style="{DynamicResource CollapsableTextblock}"
FontWeight="Bold"
Text="{Binding Result.ToolTipData.Title}"
TextWrapping="Wrap" />
<TextBlock
Style="{DynamicResource CollapsableTextblock}"
Text="{Binding Result.ToolTipData.Text}"
TextWrapping="Wrap" />
</StackPanel>
</ToolTip>
</Grid.ToolTip>
<Image
AutomationProperties.Name="{x:Static p:Resources.AppIcon}"
x:Name="AppIcon"
Height="36"
MaxWidth="56"
Grid.RowSpan="2"
Margin="-6,-2,0,0"
HorizontalAlignment="Center"
Source="{Binding Image}" />
<TextBlock AutomationProperties.Name="{x:Static p:Resources.Title}"
x:Name="Title"
Grid.Column="1"
FontSize="20"
Margin="0,0,0,-2"
VerticalAlignment="Bottom"
IsHitTestVisible="False">
<viewmodel:ResultsViewModel.FormattedText>
<MultiBinding Converter="{StaticResource highlightTextConverter}">
<Binding Path="Result.Title" />
<Binding Path="Result.TitleHighlightData" />
<Binding RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type ListViewItem}}"
Path="IsSelected" />
</MultiBinding>
</viewmodel:ResultsViewModel.FormattedText>
</TextBlock>
<TextBlock
AutomationProperties.Name="{x:Static p:Resources.Subtitle}"
x:Name="Path"
Grid.Column="1"
Text= "{Binding Result.SubTitle}"
Grid.Row="1"
Foreground="{DynamicResource SecondaryTextForeground}"
Margin="0,2,0,0"
VerticalAlignment="Top"/>
<ListView
AutomationProperties.Name="{x:Static p:Resources.ContextMenuItemsCollection}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Background="Transparent"
BorderThickness="0"
Grid.RowSpan="2"
Grid.Column="2"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ItemsSource="{Binding ContextMenuItems}"
SelectionMode="Single"
Margin="0,0,-8,0"
SelectedIndex="{Binding ContextMenuSelectedIndex}"
SelectionChanged="ContextMenuListView_SelectionChanged"
Visibility="{Binding AreContextButtonsActive, Converter={StaticResource BooleanToVisibilityConverter}}"
ItemContainerStyle="{StaticResource CommandButtonListViewItemContainerStyle}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"
VerticalAlignment="Center"
HorizontalAlignment="Center"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate>
<Button
AutomationProperties.Name="{x:Static p:Resources.ContextMenuItem}"
Style="{StaticResource IconButtonStyle}"
Command="{Binding Command}"
VerticalAlignment="Center"
Height="42"
Width="42"
Name="commandButton"
BorderThickness="1" >
<ToolTipService.ToolTip>
<ToolTip Opened="ToolTip_Opened">
<TextBlock
AutomationProperties.Name="{x:Static p:Resources.ContextMenuItemAdditionalInformation}"
Text="{Binding Title}"/>
</ToolTip>
</ToolTipService.ToolTip>
<Button.Content>
BorderThickness="0"
ItemContainerStyle="{StaticResource CommandButtonListViewItemContainerStyle}"
ItemsSource="{Binding ContextMenuItems}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
SelectedIndex="{Binding ContextMenuSelectedIndex}"
SelectionChanged="ContextMenuListView_SelectionChanged"
SelectionMode="Single"
Visibility="{Binding AreContextButtonsActive, Converter={StaticResource BooleanToVisibilityConverter}}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate>
<Button
Name="commandButton"
Width="42"
Height="42"
VerticalAlignment="Center"
AutomationProperties.Name="{x:Static p:Resources.ContextMenuItem}"
BorderThickness="1"
Command="{Binding Command}"
Style="{StaticResource SubtleButtonStyle}">
<ToolTipService.ToolTip>
<ToolTip Opened="ToolTip_Opened">
<TextBlock
AutomationProperties.Name="{x:Static p:Resources.ContextMenuIcon}"
FontFamily="{Binding FontFamily}"
FontSize="16"
Text="{Binding Glyph}"/>
</Button.Content>
</Button>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
AutomationProperties.Name="{x:Static p:Resources.ContextMenuItemAdditionalInformation}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="{Binding Title}" />
</ToolTip>
</ToolTipService.ToolTip>
<Button.Content>
<ui:FontIcon
AutomationProperties.Name="{x:Static p:Resources.ContextMenuIcon}"
FontFamily="{Binding FontFamily}"
Glyph="{Binding Glyph}" />
</Button.Content>
</Button>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</UserControl>

View File

@@ -2,6 +2,7 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Abstractions;
@@ -30,6 +31,7 @@ namespace PowerLauncher
private static readonly object _readSyncObject = new object();
private readonly PowerToysRunSettings _settings;
private readonly ThemeManager _themeManager;
private Action _refreshPluginsOverviewCallback;
private IFileSystemWatcher _watcher;
@@ -92,7 +94,7 @@ namespace PowerLauncher
foreach (var setting in overloadSettings.Plugins)
{
var plugin = PluginManager.AllPlugins.FirstOrDefault(x => x.Metadata.ID == setting.Id);
plugin?.Update(setting, App.API);
plugin?.Update(setting, App.API, _refreshPluginsOverviewCallback);
}
var openPowerlauncher = ConvertHotkey(overloadSettings.Properties.OpenPowerLauncher);
@@ -217,6 +219,11 @@ namespace PowerLauncher
Monitor.Exit(_readSyncObject);
}
public void SetRefreshPluginsOverviewCallback(Action callback)
{
_refreshPluginsOverviewCallback = callback;
}
private static string ConvertHotkey(HotkeySettings hotkey)
{
Key key = KeyInterop.KeyFromVirtualKey(hotkey.Code);

View File

@@ -0,0 +1,154 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- This removes the selection state of the default WpfUI ListViewItemStyle -->
<Style x:Key="PluginsListViewItemStyle" TargetType="{x:Type ListViewItem}">
<Setter Property="Foreground">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource TextFillColorPrimary}" />
</Setter.Value>
</Setter>
<Setter Property="Background" Value="Transparent" />
<Setter Property="Border.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="Margin" Value="0,0,0,2" />
<Setter Property="Padding" Value="4" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border
x:Name="Border"
Margin="0"
Padding="0"
Background="Transparent"
BorderThickness="1"
CornerRadius="{TemplateBinding Border.CornerRadius}">
<Grid>
<ContentPresenter Margin="{TemplateBinding Padding}" />
<Rectangle
x:Name="ActiveRectangle"
Width="4"
Height="18"
Margin="0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
RadiusX="2"
RadiusY="2"
Visibility="Collapsed">
<Rectangle.Fill>
<SolidColorBrush Color="{DynamicResource SystemAccentColorSecondary}" />
</Rectangle.Fill>
</Rectangle>
</Grid>
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="True" />
<Condition Property="IsMouseOver" Value="True" />
</MultiTrigger.Conditions>
<!--<Setter TargetName="Border" Property="Background">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource SubtleFillColorSecondary}" />
</Setter.Value>
</Setter>-->
</MultiTrigger>
<Trigger Property="IsSelected" Value="True">
<!--<Setter TargetName="ActiveRectangle" Property="Visibility" Value="Visible" />
<Setter TargetName="Border" Property="Background">
<Setter.Value>
<SolidColorBrush Color="{DynamicResource SubtleFillColorSecondary}" />
</Setter.Value>
</Setter>-->
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SubtleButtonStyle" TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Focusable" Value="False" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Padding" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border
x:Name="border"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
SnapsToDevicePixels="true">
<ContentPresenter
x:Name="contentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
TextElement.Foreground="{TemplateBinding Foreground}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsDefaulted" Value="true">
<Setter TargetName="border" Property="Background" Value="Transparent" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="border" Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
<Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TextFillColorSecondaryBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="border" Property="Background" Value="{DynamicResource SubtleFillColorTertiaryBrush}" />
<Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TextFillColorSecondaryBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<!-- <Setter TargetName="border" Property="Background" Value="{DynamicResource ControlFillColorDisabledBrush}" />
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource TextFillColorDisabledBrush}"/>-->
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CommandButtonListViewItemContainerStyle" TargetType="ListViewItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Border
x:Name="border"
Background="Transparent"
BorderBrush="Transparent"
CornerRadius="4"
SnapsToDevicePixels="true">
<ContentPresenter
x:Name="contentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="border" Property="Background" Value="Transparent" />
<Setter TargetName="border" Property="BorderBrush" Value="Transparent" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="border" Property="Background" Value="{DynamicResource SubtleFillColorTertiaryBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@@ -1,9 +1,10 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<!-- Metadata -->
<system:String x:Key="Theme.Name">Dark.Accent1</system:String>
@@ -13,20 +14,4 @@
<system:String x:Key="Theme.ColorScheme">Accent1</system:String>
<Color x:Key="Theme.PrimaryAccentColor">Black</Color>
<system:Boolean x:Key="Theme.IsHighContrast">False</system:Boolean>
<Color x:Key="SystemBaseMediumLowColor">#FF818181</Color>
<SolidColorBrush x:Key="SystemChromeLow" Color="#FF171717" options:Freeze="True" />
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="#FF818181" />
<SolidColorBrush x:Key="TextBox.Static.Border" Color="Transparent"/>
<SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="Transparent"/>
<SolidColorBrush x:Key="TextBox.Focus.Border" Color="Transparent"/>
<SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="#30FFFFFF" />
<SolidColorBrush x:Key="ButtonBorderPointerOver" Color="#61FFFFFF" />
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="#30FFFFFF" />
<SolidColorBrush x:Key="ButtonBorderPressed" Color="#61FFFFFF" />
<SolidColorBrush x:Key="ListViewItemBackgroundPointerOver" Color="#FF363636" />
<SolidColorBrush x:Key="ControlTextBrushKey" Color="White" />
<SolidColorBrush x:Key="SecondaryTextForeground" Color="#FFa1a1a1" />
<SolidColorBrush x:Key="InactiveSelectionHighlightBrushKey" Color="White" />
<SolidColorBrush x:Key="DialogBorderBrush" Color="#FF373737" />
</ResourceDictionary>

View File

@@ -1,9 +1,10 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent2</system:String>
@@ -12,20 +13,4 @@
<system:String x:Key="Theme.BaseColorScheme">HighContrast</system:String>
<system:String x:Key="Theme.ColorScheme">Accent2</system:String>
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
<Color x:Key="SystemBaseMediumLowColor">#ffff00</Color>
<SolidColorBrush x:Key="SystemChromeLow" Color="Black" options:Freeze="True" />
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="#FF008000" />
<SolidColorBrush x:Key="TextBox.Static.Border" Color="Transparent"/>
<SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="Transparent"/>
<SolidColorBrush x:Key="TextBox.Focus.Border" Color="Transparent"/>
<SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="Black" />
<SolidColorBrush x:Key="ButtonBorderPointerOver" Color="White" />
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="White" />
<SolidColorBrush x:Key="ButtonBorderPressed" Color="White" />
<SolidColorBrush x:Key="ListViewItemBackgroundPointerOver" Color="#FF003300" />
<SolidColorBrush x:Key="ControlTextBrushKey" Color="#FFffff00" />
<SolidColorBrush x:Key="SecondaryTextForeground" Color="#FF008000" />
<SolidColorBrush x:Key="InactiveSelectionHighlightBrushKey" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="DialogBorderBrush" Color="#FF373737" />
</ResourceDictionary>

View File

@@ -1,9 +1,10 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent3</system:String>
@@ -12,20 +13,4 @@
<system:String x:Key="Theme.BaseColorScheme">HighContrast</system:String>
<system:String x:Key="Theme.ColorScheme">Accent3</system:String>
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
<Color x:Key="SystemBaseMediumLowColor">#ffff00</Color>
<SolidColorBrush x:Key="SystemChromeLow" Color="Black" options:Freeze="True" />
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="#FFc0c0c0" />
<SolidColorBrush x:Key="TextBox.Static.Border" Color="Transparent"/>
<SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="Transparent"/>
<SolidColorBrush x:Key="TextBox.Focus.Border" Color="Transparent"/>
<SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="Black" />
<SolidColorBrush x:Key="ButtonBorderPointerOver" Color="Black" />
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="Black" />
<SolidColorBrush x:Key="ButtonBorderPressed" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="ListViewItemBackgroundPointerOver" Color="#FF0000ff" />
<SolidColorBrush x:Key="ControlTextBrushKey" Color="#FF00ff00" />
<SolidColorBrush x:Key="SecondaryTextForeground" Color="#FFc0c0c0" />
<SolidColorBrush x:Key="InactiveSelectionHighlightBrushKey" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="DialogBorderBrush" Color="White" />
</ResourceDictionary>

View File

@@ -1,9 +1,10 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent4</system:String>
@@ -12,20 +13,4 @@
<system:String x:Key="Theme.BaseColorScheme">HighContrast</system:String>
<system:String x:Key="Theme.ColorScheme">Accent4</system:String>
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
<Color x:Key="SystemBaseMediumLowColor">#66FFFFFF</Color>
<SolidColorBrush x:Key="SystemChromeLow" Color="Black" options:Freeze="True" />
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="#FF3ff23f" />
<SolidColorBrush x:Key="TextBox.Static.Border" Color="Transparent"/>
<SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="Transparent"/>
<SolidColorBrush x:Key="TextBox.Focus.Border" Color="Transparent"/>
<SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="#30FFFFFF" />
<SolidColorBrush x:Key="ButtonBorderPointerOver" Color="#61FFFFFF" />
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="#30FFFFFF" />
<SolidColorBrush x:Key="ButtonBorderPressed" Color="#61FFFFFF" />
<SolidColorBrush x:Key="ListViewItemBackgroundPointerOver" Color="#FF0ca7b6" />
<SolidColorBrush x:Key="ControlTextBrushKey" Color="White" />
<SolidColorBrush x:Key="SecondaryTextForeground" Color="#FF3ff23f" />
<SolidColorBrush x:Key="InactiveSelectionHighlightBrushKey" Color="White" />
<SolidColorBrush x:Key="DialogBorderBrush" Color="White" />
</ResourceDictionary>

View File

@@ -1,9 +1,10 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent5</system:String>
@@ -12,20 +13,4 @@
<system:String x:Key="Theme.BaseColorScheme">HighContrast</system:String>
<system:String x:Key="Theme.ColorScheme">Accent5</system:String>
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
<Color x:Key="SystemBaseMediumLowColor">#66000000</Color>
<SolidColorBrush x:Key="SystemChromeLow" Color="White" options:Freeze="True" />
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="#FF600000" />
<SolidColorBrush x:Key="TextBox.Static.Border" Color="Transparent"/>
<SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="Transparent"/>
<SolidColorBrush x:Key="TextBox.Focus.Border" Color="Transparent"/>
<SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="#2E000000" />
<SolidColorBrush x:Key="ButtonBorderPointerOver" Color="#61000000" />
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="#FF37006e" />
<SolidColorBrush x:Key="ButtonBorderPressed" Color="#FF37006e" />
<SolidColorBrush x:Key="ListViewItemBackgroundPointerOver" Color="#FF9a59db" />
<SolidColorBrush x:Key="ControlTextBrushKey" Color="Black" />
<SolidColorBrush x:Key="SecondaryTextForeground" Color="#FF600000" />
<SolidColorBrush x:Key="InactiveSelectionHighlightBrushKey" Color="Black" />
<SolidColorBrush x:Key="DialogBorderBrush" Color="Black" />
</ResourceDictionary>

View File

@@ -1,9 +1,10 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<!-- Metadata -->
<system:String x:Key="Theme.Name">Light.Accent1</system:String>
@@ -13,20 +14,4 @@
<system:String x:Key="Theme.ColorScheme">Accent1</system:String>
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
<system:Boolean x:Key="Theme.IsHighContrast">False</system:Boolean>
<Color x:Key="SystemBaseMediumLowColor">#66000000</Color>
<SolidColorBrush x:Key="SystemChromeLow" Color="#FFF2F2F2" options:Freeze="True" />
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="#FF5b5b5b" />
<SolidColorBrush x:Key="TextBox.Static.Border" Color="Transparent"/>
<SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="Transparent"/>
<SolidColorBrush x:Key="TextBox.Focus.Border" Color="Transparent"/>
<SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="#2E000000" />
<SolidColorBrush x:Key="ButtonBorderPointerOver" Color="#61000000" />
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="#30000000" />
<SolidColorBrush x:Key="ButtonBorderPressed" Color="#61000000" />
<SolidColorBrush x:Key="ListViewItemBackgroundPointerOver" Color="#FFd2d2d2" />
<SolidColorBrush x:Key="ControlTextBrushKey" Color="Black" />
<SolidColorBrush x:Key="SecondaryTextForeground" Color="#FF434343" />
<SolidColorBrush x:Key="InactiveSelectionHighlightBrushKey" Color="Black" />
<SolidColorBrush x:Key="DialogBorderBrush" Color="#FFf7f7f7" />
</ResourceDictionary>

View File

@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
using System.Reflection;
@@ -14,6 +15,7 @@ using System.Windows.Input;
using System.Windows.Threading;
using Common.UI;
using interop;
using Mages.Core.Runtime.Converters;
using Microsoft.PowerLauncher.Telemetry;
using Microsoft.PowerToys.Telemetry;
using PowerLauncher.Helper;
@@ -79,7 +81,6 @@ namespace PowerLauncher.ViewModel
Results = new ResultsViewModel(_settings, this);
History = new ResultsViewModel(_settings, this);
_selectedResults = Results;
InitializeKeyCommands();
RegisterResultsUpdatedEvent();
}
@@ -345,6 +346,15 @@ namespace PowerLauncher.ViewModel
if (_queryText != value)
{
_queryText = value;
if (string.IsNullOrEmpty(_queryText) || string.IsNullOrWhiteSpace(_queryText))
{
PluginsOverviewVisibility = Visibility.Visible;
}
else
{
PluginsOverviewVisibility = Visibility.Collapsed;
}
OnPropertyChanged(nameof(QueryText));
}
}
@@ -1199,5 +1209,38 @@ namespace PowerLauncher.ViewModel
action.Invoke();
}
}
public ObservableCollection<PluginPair> Plugins { get; } = new();
private Visibility _pluginsOverviewVisibility = Visibility.Visible;
public Visibility PluginsOverviewVisibility
{
get => _pluginsOverviewVisibility;
set
{
if (_pluginsOverviewVisibility != value)
{
_pluginsOverviewVisibility = value;
OnPropertyChanged(nameof(PluginsOverviewVisibility));
}
}
}
public void RefreshPluginsOverview()
{
Log.Info("Refresh plugins overview", GetType());
Application.Current.Dispatcher.Invoke(() =>
{
Plugins.Clear();
foreach (var p in PluginManager.AllPlugins.Where(a => a.IsPluginInitialized && !a.Metadata.Disabled && a.Metadata.ActionKeyword != string.Empty))
{
Plugins.Add(p);
}
});
}
}
}