Compare commits

...

2 commits

Author SHA1 Message Date
Dustin L. Howett e9b2e09e4b Migrate spelling-0.0.19 changes from main 2021-06-06 15:32:21 +02:00
Niels Laute 73fbac620c Added a plugin cheat sheet 2021-06-06 15:32:21 +02:00
18 changed files with 512 additions and 129 deletions

View file

@ -25,6 +25,7 @@ ignore$
\.png$
\.woff$
\.zip$
^doc/devdocs/akaLinks\.md$
^src/common/logger/logger\.vcxproj\.filters$
^src/common/notifications/BackgroundActivatorDLL/BackgroundActivator\.vcxproj\.filters$
^src/common/notifications/BackgroundActivatorDLL/cpp\.hint$
@ -40,3 +41,4 @@ ignore$
^\.github/
^\.github/actions/spell-check/
^\.gitmodules$
(?:^|/)WindowsSettings\.json$

File diff suppressed because it is too large Load diff

View file

@ -1,21 +1,22 @@
# spelling.yml is blocked per https://github.com/check-spelling/check-spelling/security/advisories/GHSA-g86g-chm8-7r2p
name: Spell checking
on:
pull_request_target:
push:
jobs:
build:
spelling:
name: Spell checking
runs-on: ubuntu-latest
steps:
- name: checkout-merge
if: "contains(github.event_name, 'pull_request')"
uses: actions/checkout@v2.0.0
uses: actions/checkout@v2
with:
ref: refs/pull/${{github.event.pull_request.number}}/merge
- name: checkout
if: "!contains(github.event_name, 'pull_request')"
uses: actions/checkout@v2.0.0
- uses: check-spelling/check-spelling@v0.0.18
uses: actions/checkout@v2
- uses: check-spelling/check-spelling@v0.0.19
with:
config: .github/actions/spell-check

View file

@ -0,0 +1,23 @@
<UserControl x:Class="PowerLauncher.CheatSheetControl"
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:local="clr-namespace:PowerLauncher"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<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>
</Grid>
</UserControl>

View file

@ -0,0 +1,30 @@
// Copyright (c) Microsoft Corporation
// 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.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace PowerLauncher
{
/// <summary>
/// Interaction logic for CheatSheetControl.xaml
/// </summary>
public partial class CheatSheetControl : UserControl
{
public CheatSheetControl()
{
InitializeComponent();
}
}
}

View file

@ -0,0 +1,31 @@
// Copyright (c) Microsoft Corporation
// 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.Globalization;
using System.Windows;
using System.Windows.Data;
namespace PowerLauncher.Converters
{
public class EmptyStringToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (string.IsNullOrEmpty((string)value))
{
return Visibility.Visible;
}
else
{
return Visibility.Collapsed;
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View file

@ -7,10 +7,12 @@
xmlns:p="clr-namespace:PowerLauncher.Properties"
xmlns:local="clr-namespace:PowerLauncher"
xmlns:ui="http://schemas.modernwpf.com/2019"
mc:Ignorable="d"
xmlns:converters="clr-namespace:PowerLauncher.Converters"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="720">
<UserControl.Resources>
<converters:EmptyStringToVisibilityConverter x:Key="emptyStringToVisibilityConverter" />
<Style x:Key="QueryTextBoxStyle" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
@ -24,12 +26,12 @@
<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="Padding" Value="0,0,0,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Grid>
<TextBlock Margin="14, 0, 0, 0"
<TextBlock Margin="0, 0, 0, 0"
Text="{TemplateBinding Tag}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
@ -43,7 +45,7 @@
</TextBlock.Style>
</TextBlock>
<Border x:Name="border"
Background="{TemplateBinding Background}"
Background="Transparent"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
SnapsToDevicePixels="True">
@ -88,50 +90,105 @@
</Style.Triggers>
</Style>
</UserControl.Resources>
<Grid
Height="68"
VerticalAlignment="Top">
<!--Background="{ThemeResource BackdropAcrylicBrush}"-->
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="72"/>
</Grid.ColumnDefinitions>
<!--
<Grid>
<StackPanel Orientation="Vertical">
<Grid Height="72"
Margin="1 "
Background="{DynamicResource PrimaryBackgroundBrush}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="72" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!--
for adding on placeholder, look at the style with 90 votes
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"
VerticalAlignment="Center"
FontSize="24"
Style="{StaticResource QueryTextBoxStyle}"
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"
VerticalAlignment="Center"
Foreground="{DynamicResource TextControlPlaceholderForeground}"
SnapsToDevicePixels="True"/>
<TextBlock AutomationProperties.Name="{x:Static p:Resources.SearchIcon}"
Text="&#xE721;"
FontFamily="Segoe MDL2 Assets"
FontSize="26"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{DynamicResource TextControlPlaceholderForeground}"
SnapsToDevicePixels="True" />
<TextBlock x:Name="AutoCompleteTextBlock"
x:FieldModifier="public"
Opacity="0.6"
Grid.Column="1"
Canvas.ZIndex="-1"
Margin="1, 0, 14, 0"
VerticalAlignment="Center"
FontSize="24"
Foreground="{DynamicResource TextControlPlaceholderForeground}"
Background="Transparent" />
<local:CustomSearchBox AutomationProperties.Name="{x:Static p:Resources.Query}"
x:Name="QueryTextBox"
x:FieldModifier="public"
Canvas.ZIndex="0"
Margin="0, 0, 0, 0"
Grid.Column="1"
VerticalAlignment="Center"
FontSize="24"
Style="{StaticResource QueryTextBoxStyle}"
Tag="{x:Static p:Resources.startTyping}" />
</Grid>
<Rectangle Height="1"
Opacity="0.4"
Margin="1,0,1,0"
Fill="{DynamicResource SecondaryTextForeground}" />
<ui:ListView x:Name="CheatSheetControl"
Visibility="{Binding ElementName=QueryTextBox, Path=Text, Converter={StaticResource emptyStringToVisibilityConverter}}"
Margin="0,16,0,12"
MinWidth="0"
Padding="0"
Grid.ColumnSpan="2">
<ui:ListView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Background="{DynamicResource PrimaryBackgroundBrush}"
Width="32"
Margin="8,8,0,8"
Height="32"
HorizontalAlignment="Left"
Padding="4"
CornerRadius="4">
<Border.Effect>
<DropShadowEffect BlurRadius="2"
Opacity="0.32"
ShadowDepth="1" />
</Border.Effect>
<TextBlock Grid.RowSpan="2"
FontWeight="SemiBold"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="15"
Margin="0,-2,0,0"
Foreground="{DynamicResource PrimaryTextForeground}"
Text="{Binding Metadata.ActionKeyword}" />
</Border>
<TextBlock Grid.Column="1"
Grid.Row="1"
VerticalAlignment="Center"
Margin="22,0,0,0"
FontSize="12"
Text="{Binding Plugin.Description}"
Foreground="{DynamicResource SecondaryTextForeground}" />
</Grid>
</DataTemplate>
</ui:ListView.ItemTemplate>
</ui:ListView>
</StackPanel>
</Grid>
</UserControl>

View file

@ -47,18 +47,19 @@
</Window.Resources>
<Grid Width="720"
MouseDown="OnMouseDown">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid
x:Name="SearchBoxBorder"
Grid.Row="0"
Margin="24,24,24,24">
<Rectangle
Fill="{DynamicResource SystemChromeLow}"
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Rectangle Fill="{DynamicResource SystemChromeLow}"
RadiusX="4"
RadiusY="4"
Grid.RowSpan="2"
Stroke="{DynamicResource DialogBorderBrush}"
StrokeThickness="1">
<Rectangle.Effect>
@ -74,37 +75,18 @@
<!--<Border.RenderTransform>
<TranslateTransform />
</Border.RenderTransform>-->
</Grid>
<Grid
x:Name="ListBoxBorder"
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 x:Name="ListBox"
Grid.Row="1"
Margin="1"
Visibility="{Binding Results.Visibility}"
PreviewMouseDown="ListBox_PreviewMouseDown">
<!--<local:ResultList.RenderTransform>
<TranslateTransform />
</local:ResultList.RenderTransform>-->
</local:ResultList>
<Rectangle
RadiusX="4"
RadiusY="4"
Stroke="{DynamicResource DialogBorderBrush}"
StrokeThickness="1" />
</Grid>
</Grid>
<Window.InputBindings>
<KeyBinding Key="Escape"

View file

@ -61,6 +61,11 @@ namespace PowerLauncher
PowerToysTelemetry.Log.WriteEvent(telemetryEvent);
}
public void GetPluginCheatSheet()
{
SearchBox.CheatSheetControl.ItemsSource = PluginManager.AllPlugins;
}
private void CheckForFirstDelete(object sender, ElapsedEventArgs e)
{
if (_firstDeleteTimer != null)
@ -116,7 +121,7 @@ namespace PowerLauncher
ListBox.SuggestionsList.SelectionChanged += SuggestionsList_SelectionChanged;
ListBox.SuggestionsList.PreviewMouseLeftButtonUp += SuggestionsList_PreviewMouseLeftButtonUp;
_viewModel.PropertyChanged += ViewModel_PropertyChanged;
GetPluginCheatSheet();
BringProcessToForeground();
}
@ -327,7 +332,7 @@ namespace PowerLauncher
private void SuggestionsList_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
ListView listview = (ListView)sender;
ModernWpf.Controls.ListView listview = (ModernWpf.Controls.ListView)sender;
_viewModel.Results.SelectedItem = (ResultViewModel)listview.SelectedItem;
if (e.AddedItems.Count > 0 && e.AddedItems[0] != null)
{

View file

@ -6,7 +6,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:p="clr-namespace:PowerLauncher.Properties"
mc:Ignorable="d"
xmlns:ui="clr-namespace:ModernWpf.Controls;assembly=ModernWpf.Controls"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="720">
@ -77,12 +78,12 @@
</Setter>
</Style>
<Style x:Key="ResultsListViewItemContainerStyle" TargetType="ListViewItem">
<Style x:Key="ResultsListViewItemContainerStyle" TargetType="ui:ListViewItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource ControlTextBrushKey}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<ControlTemplate TargetType="{x:Type ui:ListViewItem}">
<Grid Background="Transparent">
<Border x:Name="HighlightBorder"
BorderThickness="0"
@ -158,7 +159,7 @@
</UserControl.Resources>
<Grid VerticalAlignment="Top">
<ListView
<ui:ListView
x:Name="SuggestionsList"
x:FieldModifier="public"
Background="Transparent"
@ -177,7 +178,7 @@
<!--AllowFocusOnInteraction="False"
IsItemClickEnabled="True"-->
<!--Style="{StaticResource ListViewNoAnimations}"-->
<ListView.ItemTemplate>
<ui:ListView.ItemTemplate>
<DataTemplate>
<Grid
Height="72"
@ -194,7 +195,7 @@
</Behaviors:EventTrigger>
</Behaviors:Interaction.Triggers>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="64" />
<ColumnDefinition Width="48" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
@ -220,10 +221,10 @@
<Image
AutomationProperties.Name="{x:Static p:Resources.AppIcon}"
x:Name="AppIcon"
Height="36"
Height="24"
MaxWidth="56"
Grid.RowSpan="2"
Margin="-6,-2,0,0"
Margin="0,-2,0,0"
HorizontalAlignment="Center"
Source="{Binding Image}" />
<TextBlock
@ -231,8 +232,8 @@
x:Name="Title" Grid.Column="1"
Text="{Binding Result.Title}"
FontWeight="SemiBold"
FontSize="20"
Margin="0,0,0,-2"
FontSize="18"
Margin="12,0,0,-2"
VerticalAlignment="Bottom"/>
<TextBlock
AutomationProperties.Name="{x:Static p:Resources.Subtitle}"
@ -240,8 +241,9 @@
Grid.Column="1"
Text= "{Binding Result.SubTitle}"
Grid.Row="1"
FontSize="12"
Foreground="{DynamicResource SecondaryTextForeground}"
Margin="0,2,0,0"
Margin="12,2,0,0"
VerticalAlignment="Top"/>
<ListView
AutomationProperties.Name="{x:Static p:Resources.ContextMenuItemsCollection}"
@ -255,7 +257,7 @@
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ItemsSource="{Binding ContextMenuItems}"
SelectionMode="Single"
Margin="0,0,-8,0"
Margin="0,0,0,0"
SelectedIndex="{Binding ContextMenuSelectedIndex}"
Visibility="{Binding AreContextButtonsActive, Converter={StaticResource BooleanToVisibilityConverter}}"
ItemContainerStyle="{StaticResource CommandButtonListViewItemContainerStyle}">
@ -296,7 +298,7 @@
</ListView>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ui:ListView.ItemTemplate>
</ui:ListView>
</Grid>
</UserControl>

View file

@ -15,6 +15,8 @@
<system:Boolean x:Key="Theme.IsHighContrast">False</system:Boolean>
<Color x:Key="SystemBaseMediumLowColor">#FF818181</Color>
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FF3a3a3a" />
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FF333333" />
<SolidColorBrush x:Key="SystemChromeLow" Color="#FF171717" options:Freeze="True" />
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="#FF818181" />
<SolidColorBrush x:Key="TextBox.Static.Border" Color="Transparent"/>

View file

@ -14,6 +14,8 @@
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
<Color x:Key="SystemBaseMediumLowColor">#ffff00</Color>
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FF3a3a3a" />
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FF333333" />
<SolidColorBrush x:Key="SystemChromeLow" Color="Black" options:Freeze="True" />
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="#FF008000" />
<SolidColorBrush x:Key="TextBox.Static.Border" Color="Transparent"/>

View file

@ -14,6 +14,8 @@
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
<Color x:Key="SystemBaseMediumLowColor">#ffff00</Color>
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FF3a3a3a" />
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FF333333" />
<SolidColorBrush x:Key="SystemChromeLow" Color="Black" options:Freeze="True" />
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="#FFc0c0c0" />
<SolidColorBrush x:Key="TextBox.Static.Border" Color="Transparent"/>

View file

@ -14,6 +14,8 @@
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
<Color x:Key="SystemBaseMediumLowColor">#66FFFFFF</Color>
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FF3a3a3a" />
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FF333333" />
<SolidColorBrush x:Key="SystemChromeLow" Color="Black" options:Freeze="True" />
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="#FF3ff23f" />
<SolidColorBrush x:Key="TextBox.Static.Border" Color="Transparent"/>

View file

@ -14,6 +14,8 @@
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
<Color x:Key="SystemBaseMediumLowColor">#66000000</Color>
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FFededed" />
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FFe5e5e5" />
<SolidColorBrush x:Key="SystemChromeLow" Color="White" options:Freeze="True" />
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="#FF600000" />
<SolidColorBrush x:Key="TextBox.Static.Border" Color="Transparent"/>

View file

@ -15,6 +15,8 @@
<system:Boolean x:Key="Theme.IsHighContrast">False</system:Boolean>
<Color x:Key="SystemBaseMediumLowColor">#66000000</Color>
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FFededed" />
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FFe5e5e5" />
<SolidColorBrush x:Key="SystemChromeLow" Color="#FFF2F2F2" options:Freeze="True" />
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="#FF5b5b5b" />
<SolidColorBrush x:Key="TextBox.Static.Border" Color="Transparent"/>

View file

@ -381,7 +381,7 @@ namespace PowerLauncher.ViewModel
}
else
{
Results.Visibility = Visibility.Hidden;
Results.Visibility = Visibility.Collapsed;
_queryTextBeforeLeaveResults = QueryText;
// Because of Fody's optimization
@ -652,7 +652,7 @@ namespace PowerLauncher.ViewModel
_updateSource?.Cancel();
_currentQuery = _emptyQuery;
Results.SelectedItem = null;
Results.Visibility = Visibility.Hidden;
Results.Visibility = Visibility.Collapsed;
Task.Run(() =>
{
lock (_addResultsLock)

View file

@ -97,7 +97,7 @@ namespace PowerLauncher.ViewModel
public Thickness Margin { get; set; }
private Visibility _visibility = Visibility.Hidden;
private Visibility _visibility = Visibility.Collapsed;
public Visibility Visibility
{