Merge remote-tracking branch 'origin/main' into dev/snickler/net8-upgrade

This commit is contained in:
Jeremy Sinclair 2023-10-11 09:30:07 -04:00
commit f058e81ed0
30 changed files with 1487 additions and 1298 deletions

View File

@ -107,7 +107,7 @@ if (-not $Passive)
else
{
Write-Output "Checking all files (passively)"
$files = Get-ChildItem -Path "$PSScriptRoot\..\src\*.xaml" -Recurse | Select-Object -ExpandProperty FullName | Where-Object { $_ -notmatch "(\\obj\\)|(\\bin\\)|(\\x64\\)|(\\launcher\\PowerLauncher\\)|(\\launcher\\Wox.Plugin\\)|(\\colorPicker\\ColorPickerUI\\)|(\\editor\\FancyZonesEditor\\)|(\\settings-ui\\Settings.UI\\)" }
$files = Get-ChildItem -Path "$PSScriptRoot\..\src\*.xaml" -Recurse | Select-Object -ExpandProperty FullName | Where-Object { $_ -notmatch "(\\obj\\)|(\\bin\\)|(\\x64\\)|(\\launcher\\PowerLauncher\\)|(\\launcher\\Wox.Plugin\\)|(\\colorPicker\\ColorPickerUI\\)|(\\settings-ui\\Settings.UI\\)" }
if ($files.count -gt 0)
{

View File

@ -1,10 +1,11 @@
<Application x:Class="FancyZonesEditor.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FancyZonesEditor"
xmlns:ui="http://schemas.modernwpf.com/2019"
Startup="OnStartup"
Exit="OnExit">
<Application
x:Class="FancyZonesEditor.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FancyZonesEditor"
xmlns:ui="http://schemas.modernwpf.com/2019"
Exit="OnExit"
Startup="OnStartup">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
@ -15,7 +16,7 @@
<ResourceDictionary Source="pack://application:,,,/Styles/LayoutPreviewStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="HeadingTextBlock" TargetType="TextBlock"/>
<Style x:Key="HeadingTextBlock" TargetType="TextBlock" />
</ResourceDictionary>
</Application.Resources>
</Application>

View File

@ -1,13 +1,15 @@
<UserControl x:Class="FancyZonesEditor.CanvasEditor"
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"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<UserControl
x:Class="FancyZonesEditor.CanvasEditor"
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"
d:DesignHeight="300"
d:DesignWidth="300"
mc:Ignorable="d">
<Grid x:Name="Body">
<Viewbox Stretch="Uniform">
<Canvas x:Name="Preview"/>
<Canvas x:Name="Preview" />
</Viewbox>
</Grid>
</UserControl>

View File

@ -1,57 +1,63 @@
<local:EditorWindow x:Class="FancyZonesEditor.CanvasEditorWindow"
AutomationProperties.Name="{x:Static props:Resources.Canvas_Layout_Editor}"
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:local="clr-namespace:FancyZonesEditor"
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
mc:Ignorable="d"
Title=""
Height="196"
MinWidth="360"
BorderThickness="0"
xmlns:ui="http://schemas.modernwpf.com/2019"
ui:WindowHelper.UseModernWindowStyle="True"
ui:TitleBar.IsIconVisible="False"
SizeToContent="Width"
Background="{DynamicResource PrimaryBackgroundBrush}"
ResizeMode="NoResize"
WindowStartupLocation="CenterOwner"
ContentRendered="EditorWindow_ContentRendered"
Closed="OnClosed">
<local:EditorWindow
x:Class="FancyZonesEditor.CanvasEditorWindow"
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:FancyZonesEditor"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
xmlns:ui="http://schemas.modernwpf.com/2019"
Title=""
Height="196"
MinWidth="360"
ui:TitleBar.IsIconVisible="False"
ui:WindowHelper.UseModernWindowStyle="True"
AutomationProperties.Name="{x:Static props:Resources.Canvas_Layout_Editor}"
Background="{DynamicResource PrimaryBackgroundBrush}"
BorderThickness="0"
Closed="OnClosed"
ContentRendered="EditorWindow_ContentRendered"
ResizeMode="NoResize"
SizeToContent="Width"
WindowStartupLocation="CenterOwner"
mc:Ignorable="d">
<Grid Height="160">
<Grid Height="36"
Background="{DynamicResource SecondaryBackgroundBrush}"
Margin="0,-36,0,0"
VerticalAlignment="Top"
HorizontalAlignment="Stretch">
<Border Background="{DynamicResource TitleBarSecondaryForegroundBrush}"
Width="30"
Height="3"
CornerRadius="1.5"
VerticalAlignment="Center"
Margin="0,4,0,0" />
<Grid
Height="36"
Margin="0,-36,0,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
Background="{DynamicResource SecondaryBackgroundBrush}">
<Border
Width="30"
Height="3"
Margin="0,4,0,0"
VerticalAlignment="Center"
Background="{DynamicResource TitleBarSecondaryForegroundBrush}"
CornerRadius="1.5" />
</Grid>
<StackPanel Margin="16" VerticalAlignment="Bottom"
FocusManager.FocusedElement="{Binding ElementName=newZoneButton}">
<StackPanel
Margin="16"
VerticalAlignment="Bottom"
FocusManager.FocusedElement="{Binding ElementName=newZoneButton}">
<local:ClickAutomationEventButton x:Name="newZoneButton"
HorizontalAlignment="Stretch"
Height="64"
Width="64"
ui:ControlHelper.CornerRadius="64"
Margin="0,8,0,0"
Style="{StaticResource AccentButtonStyle}"
FontFamily="{StaticResource SymbolThemeFontFamily}"
Content="&#xE710;"
FontSize="24"
TabIndex="0"
ToolTip="{x:Static props:Resources.Add_zone}"
DataContext="{Binding Path=Model, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
IsEnabled="{Binding IsZoneAddingAllowed}"
Click="OnAddZone"
OnClickAutomationValue="{x:Static props:Resources.New_zone_added}" />
<local:ClickAutomationEventButton
x:Name="newZoneButton"
Width="64"
Height="64"
Margin="0,8,0,0"
HorizontalAlignment="Stretch"
ui:ControlHelper.CornerRadius="64"
Click="OnAddZone"
Content="&#xE710;"
DataContext="{Binding Path=Model, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
FontFamily="{StaticResource SymbolThemeFontFamily}"
FontSize="24"
IsEnabled="{Binding IsZoneAddingAllowed}"
OnClickAutomationValue="{x:Static props:Resources.New_zone_added}"
Style="{StaticResource AccentButtonStyle}"
TabIndex="0"
ToolTip="{x:Static props:Resources.Add_zone}" />
<Grid Margin="0,24,0,-4">
<Grid.ColumnDefinitions>
@ -59,17 +65,19 @@
<ColumnDefinition Width="8" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Content="{x:Static props:Resources.Cancel}"
Style="{StaticResource DefaultButtonStyle}"
HorizontalAlignment="Stretch"
Grid.Column="2"
TabIndex="2"
Click="OnCancel" />
<Button Content="{x:Static props:Resources.Save_Apply}"
Style="{StaticResource AccentButtonStyle}"
TabIndex="1"
HorizontalAlignment="Stretch"
Click="OnSaveApplyTemplate" />
<Button
Grid.Column="2"
HorizontalAlignment="Stretch"
Click="OnCancel"
Content="{x:Static props:Resources.Cancel}"
Style="{StaticResource DefaultButtonStyle}"
TabIndex="2" />
<Button
HorizontalAlignment="Stretch"
Click="OnSaveApplyTemplate"
Content="{x:Static props:Resources.Save_Apply}"
Style="{StaticResource AccentButtonStyle}"
TabIndex="1" />
</Grid>
</StackPanel>
</Grid>

View File

@ -1,40 +1,47 @@
<UserControl x:Class="FancyZonesEditor.CanvasZone"
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:props="clr-namespace:FancyZonesEditor.Properties"
xmlns:local="clr-namespace:FancyZonesEditor"
mc:Ignorable="d"
KeyDown="Border_KeyDown"
Background="Transparent"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl
x:Class="FancyZonesEditor.CanvasZone"
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:FancyZonesEditor"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
d:DesignHeight="450"
d:DesignWidth="800"
Background="Transparent"
KeyDown="Border_KeyDown"
mc:Ignorable="d">
<UserControl.Resources>
<Style x:Key="CanvasZoneThumbStyle" TargetType="{x:Type Thumb}">
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border x:Name="ThumbBorder"
Opacity="0"
CornerRadius="0"
BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}">
<Border
x:Name="ThumbBorder"
Background="{TemplateBinding Background}"
BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="0"
Opacity="0">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates" >
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.15">
<VisualTransition.GeneratedEasingFunction>
<ExponentialEase EasingMode="EaseInOut"/>
<ExponentialEase EasingMode="EaseInOut" />
</VisualTransition.GeneratedEasingFunction>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="ThumbBorder" Duration="0:0:0.15" Storyboard.TargetProperty="Opacity" To="1"/>
<DoubleAnimation
Storyboard.TargetName="ThumbBorder"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0:0:0.15" />
</Storyboard>
</VisualState>
</VisualStateGroup>
@ -45,52 +52,39 @@
</Setter>
</Style>
<Style x:Key="CloseButtonStyle"
TargetType="{x:Type Button}">
<Setter Property="BorderThickness"
Value="1" />
<Setter Property="HorizontalContentAlignment"
Value="Center" />
<Setter Property="VerticalContentAlignment"
Value="Center" />
<Setter Property="Foreground"
Value="{DynamicResource PrimaryForegroundBrush}" />
<Setter Property="Padding"
Value="1" />
<Style x:Key="CloseButtonStyle" TargetType="{x:Type Button}">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Foreground" Value="{DynamicResource PrimaryForegroundBrush}" />
<Setter Property="Padding" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="border"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
SnapsToDevicePixels="true">
<ContentPresenter x:Name="contentPresenter"
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Border
x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
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="IsDefaulted"
Value="true">
<Setter Property="BorderBrush"
TargetName="border"
Value="{DynamicResource SystemControlBackgroundAccentBrush}" />
<Trigger Property="IsDefaulted" Value="true">
<Setter TargetName="border" Property="BorderBrush" Value="{DynamicResource SystemControlBackgroundAccentBrush}" />
</Trigger>
<Trigger Property="IsMouseOver"
Value="true">
<Setter Property="Opacity"
TargetName="contentPresenter"
Value="0.6" />
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="contentPresenter" Property="Opacity" Value="0.6" />
</Trigger>
<Trigger Property="IsPressed"
Value="true">
<Setter Property="Opacity"
TargetName="contentPresenter"
Value="0.4" />
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="contentPresenter" Property="Opacity" Value="0.4" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
@ -99,99 +93,182 @@
</Style>
</UserControl.Resources>
<Border CornerRadius="0"
Focusable="True"
x:Name="RootBorder"
PreviewMouseDown="Border_PreviewMouseDown">
<Border
x:Name="RootBorder"
CornerRadius="0"
Focusable="True"
PreviewMouseDown="Border_PreviewMouseDown">
<Border.Style>
<Style>
<Setter Property="Border.Background"
Value="{DynamicResource CanvasZoneBackgroundBrush}" />
<Setter Property="Border.BorderBrush"
Value="{DynamicResource CanvasZoneBorderBrush}" />
<Setter Property="Border.BorderThickness"
Value="1"/>
<Setter Property="Border.Background" Value="{DynamicResource CanvasZoneBackgroundBrush}" />
<Setter Property="Border.BorderBrush" Value="{DynamicResource CanvasZoneBorderBrush}" />
<Setter Property="Border.BorderThickness" Value="1" />
<Style.Triggers>
<Trigger Property="Border.IsKeyboardFocused"
Value="true">
<Setter Property="Border.BorderThickness"
Value="4" />
<Setter Property="Border.BorderBrush"
Value="{DynamicResource SystemControlBackgroundAccentBrush}" />
<Trigger Property="Border.IsKeyboardFocused" Value="true">
<Setter Property="Border.BorderThickness" Value="4" />
<Setter Property="Border.BorderBrush" Value="{DynamicResource SystemControlBackgroundAccentBrush}" />
</Trigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid x:Name="Frame">
<Grid.RowDefinitions>
<RowDefinition Height="8"/>
<RowDefinition Height="16"/>
<RowDefinition Height="*"/>
<RowDefinition Height="16"/>
<RowDefinition Height="8"/>
<RowDefinition Height="8" />
<RowDefinition Height="16" />
<RowDefinition Height="*" />
<RowDefinition Height="16" />
<RowDefinition Height="8" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="8"/>
<ColumnDefinition Width="16"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="16"/>
<ColumnDefinition Width="8"/>
<ColumnDefinition Width="8" />
<ColumnDefinition Width="16" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="16" />
<ColumnDefinition Width="8" />
</Grid.ColumnDefinitions>
<DockPanel HorizontalAlignment="Center"
VerticalAlignment="Center"
Grid.Column="2"
Grid.Row="2">
<DockPanel
Grid.Row="2"
Grid.Column="2"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Label
Name="LabelID"
DockPanel.Dock="Top"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Content="ID"
FontWeight="SemiBold"
DockPanel.Dock="Top"
FontSize="64"
FontWeight="SemiBold"
Foreground="{Binding ElementName=RootBorder, Path=BorderBrush}" />
<TextBlock FontSize="16"
Foreground="{Binding ElementName=RootBorder, Path=BorderBrush}"
Opacity="0.6"
DockPanel.Dock="Bottom"
FontWeight="SemiBold"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Run x:Name="WidthLabel" />
<Run Text="&#xE947;"
FontSize="10"
FontFamily="{StaticResource SymbolThemeFontFamily}" />
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
DockPanel.Dock="Bottom"
FontSize="16"
FontWeight="SemiBold"
Foreground="{Binding ElementName=RootBorder, Path=BorderBrush}"
Opacity="0.6">
<Run x:Name="WidthLabel" />
<Run
FontFamily="{StaticResource SymbolThemeFontFamily}"
FontSize="10"
Text="&#xE947;" />
<Run x:Name="HeightLabel" />
</TextBlock>
</DockPanel>
<Thumb x:Name="Caption" Cursor="SizeAll" Background="Transparent" BorderThickness="3" Padding="4" Grid.Column="0" Grid.ColumnSpan="5" Margin="-1" Grid.Row="0" Grid.RowSpan="5" DragDelta="UniversalDragDelta" DragStarted="Caption_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
<Thumb
x:Name="Caption"
Grid.Row="0"
Grid.RowSpan="5"
Grid.Column="0"
Grid.ColumnSpan="5"
Margin="-1"
Padding="4"
Background="Transparent"
BorderThickness="3"
Cursor="SizeAll"
DragDelta="UniversalDragDelta"
DragStarted="Caption_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb x:Name="NResize" Cursor="SizeNS" BorderThickness="0,2,0,0" Grid.ColumnSpan="5" DragDelta="UniversalDragDelta" DragStarted="NResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
<Thumb x:Name="SResize" Cursor="SizeNS" BorderThickness="0,0,0,2" Grid.Row="4" Grid.ColumnSpan="5" DragDelta="UniversalDragDelta" DragStarted="SResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
<Thumb x:Name="WResize" Cursor="SizeWE" BorderThickness="2,0,0,0" Grid.RowSpan="5" DragDelta="UniversalDragDelta" DragStarted="WResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
<Thumb x:Name="EResize" Cursor="SizeWE" BorderThickness="0,0,2,0" Grid.Column="4" Grid.RowSpan="5" DragDelta="UniversalDragDelta" DragStarted="EResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
<Thumb
x:Name="NResize"
Grid.ColumnSpan="5"
BorderThickness="0,2,0,0"
Cursor="SizeNS"
DragDelta="UniversalDragDelta"
DragStarted="NResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb
x:Name="SResize"
Grid.Row="4"
Grid.ColumnSpan="5"
BorderThickness="0,0,0,2"
Cursor="SizeNS"
DragDelta="UniversalDragDelta"
DragStarted="SResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb
x:Name="WResize"
Grid.RowSpan="5"
BorderThickness="2,0,0,0"
Cursor="SizeWE"
DragDelta="UniversalDragDelta"
DragStarted="WResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb
x:Name="EResize"
Grid.RowSpan="5"
Grid.Column="4"
BorderThickness="0,0,2,0"
Cursor="SizeWE"
DragDelta="UniversalDragDelta"
DragStarted="EResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb x:Name="NWResize" Cursor="SizeNWSE" BorderThickness="2,2,0,0" Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2" DragDelta="UniversalDragDelta" DragStarted="NWResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
<Thumb x:Name="NEResize" Cursor="SizeNESW" BorderThickness="0,2,2,0" Grid.Row="0" Grid.Column="3" Grid.RowSpan="2" Grid.ColumnSpan="2" DragDelta="UniversalDragDelta" DragStarted="NEResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
<Thumb x:Name="SWResize" Cursor="SizeNESW" BorderThickness="2,0,0,2" Grid.Row="3" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2" DragDelta="UniversalDragDelta" DragStarted="SWResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
<Thumb x:Name="SEResize" Cursor="SizeNWSE" BorderThickness="0,0,2,2" Grid.Row="3" Grid.Column="3" Grid.RowSpan="2" Grid.ColumnSpan="2" DragDelta="UniversalDragDelta" DragStarted="SEResize_DragStarted" Style="{DynamicResource CanvasZoneThumbStyle}"/>
<Thumb
x:Name="NWResize"
Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="0"
Grid.ColumnSpan="2"
BorderThickness="2,2,0,0"
Cursor="SizeNWSE"
DragDelta="UniversalDragDelta"
DragStarted="NWResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb
x:Name="NEResize"
Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="3"
Grid.ColumnSpan="2"
BorderThickness="0,2,2,0"
Cursor="SizeNESW"
DragDelta="UniversalDragDelta"
DragStarted="NEResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb
x:Name="SWResize"
Grid.Row="3"
Grid.RowSpan="2"
Grid.Column="0"
Grid.ColumnSpan="2"
BorderThickness="2,0,0,2"
Cursor="SizeNESW"
DragDelta="UniversalDragDelta"
DragStarted="SWResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Thumb
x:Name="SEResize"
Grid.Row="3"
Grid.RowSpan="2"
Grid.Column="3"
Grid.ColumnSpan="2"
BorderThickness="0,0,2,2"
Cursor="SizeNWSE"
DragDelta="UniversalDragDelta"
DragStarted="SEResize_DragStarted"
Style="{DynamicResource CanvasZoneThumbStyle}" />
<Button Content="&#xE894;"
BorderThickness="0"
ToolTip="{x:Static props:Resources.Delete_Zone}"
Background="Transparent"
FontSize="16"
Padding="4"
Click="OnClose"
IsTabStop="False"
Focusable="False"
Grid.Row="2"
Grid.Column="2"
FontFamily="{StaticResource SymbolThemeFontFamily}"
HorizontalAlignment="Right"
VerticalAlignment="Top" Style="{DynamicResource CloseButtonStyle}"/>
<Button
Grid.Row="2"
Grid.Column="2"
Padding="4"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="Transparent"
BorderThickness="0"
Click="OnClose"
Content="&#xE894;"
Focusable="False"
FontFamily="{StaticResource SymbolThemeFontFamily}"
FontSize="16"
IsTabStop="False"
Style="{DynamicResource CloseButtonStyle}"
ToolTip="{x:Static props:Resources.Delete_Zone}" />
<Canvas x:Name="Body" />
</Grid>

View File

@ -1,9 +1,10 @@
<Button x:Class="FancyZonesEditor.ClickAutomationEventButton"
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:FancyZonesEditor"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
</Button>
<Button
x:Class="FancyZonesEditor.ClickAutomationEventButton"
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:FancyZonesEditor"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d" />

View File

@ -1,5 +1,5 @@
<Slider x:Class="FancyZonesEditor.Controls.CustomSlider"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FancyZonesEditor.Controls">
</Slider>
<Slider
x:Class="FancyZonesEditor.Controls.CustomSlider"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FancyZonesEditor.Controls" />

View File

@ -13,29 +13,32 @@
<Grid>
<Canvas x:Name="Preview" />
<Canvas x:Name="AdornerLayer" />
<Canvas x:Name="MergePanel"
MouseUp="MergePanelMouseUp"
Visibility="Collapsed">
<Canvas
x:Name="MergePanel"
MouseUp="MergePanelMouseUp"
Visibility="Collapsed">
<Canvas.Effect>
<DropShadowEffect BlurRadius="6" Opacity="0.32" ShadowDepth="2" />
<DropShadowEffect
BlurRadius="6"
Opacity="0.32"
ShadowDepth="2" />
</Canvas.Effect>
<StackPanel x:Name="MergeButtons"
Orientation="Horizontal">
<Border CornerRadius="4"
Background="{DynamicResource PrimaryBackgroundBrush}">
<Button Width="134"
Height="36"
Margin="0"
Style="{StaticResource DefaultButtonStyle}"
Click="MergeClick">
<StackPanel x:Name="MergeButtons" Orientation="Horizontal">
<Border Background="{DynamicResource PrimaryBackgroundBrush}" CornerRadius="4">
<Button
Width="134"
Height="36"
Margin="0"
Click="MergeClick"
Style="{StaticResource DefaultButtonStyle}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="&#xE746;"
FontFamily="{StaticResource SymbolThemeFontFamily}"
Foreground="{DynamicResource PrimaryForegroundBrush}"
Margin="0,3,8,0" />
<TextBlock Text="{x:Static props:Resources.Merge_zones}"
Foreground="{DynamicResource PrimaryForegroundBrush}"/>
<TextBlock
Margin="0,3,8,0"
FontFamily="{StaticResource SymbolThemeFontFamily}"
Foreground="{DynamicResource PrimaryForegroundBrush}"
Text="&#xE746;" />
<TextBlock Foreground="{DynamicResource PrimaryForegroundBrush}" Text="{x:Static props:Resources.Merge_zones}" />
</StackPanel>
</Button>
</Border>

View File

@ -1,86 +1,81 @@
<local:EditorWindow x:Class="FancyZonesEditor.GridEditorWindow"
AutomationProperties.Name="{x:Static props:Resources.Grid_Layout_Editor}"
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:local="clr-namespace:FancyZonesEditor"
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
mc:Ignorable="d"
Title=""
MinWidth="360"
BorderThickness="0"
xmlns:ui="http://schemas.modernwpf.com/2019"
ui:WindowHelper.UseModernWindowStyle="True"
ui:TitleBar.IsIconVisible="False"
SizeToContent="WidthAndHeight"
Background="{DynamicResource PrimaryBackgroundBrush}"
ResizeMode="NoResize"
WindowStartupLocation="CenterOwner"
ContentRendered="EditorWindow_ContentRendered"
Closed="OnClosed">
<local:EditorWindow
x:Class="FancyZonesEditor.GridEditorWindow"
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:FancyZonesEditor"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
xmlns:ui="http://schemas.modernwpf.com/2019"
Title=""
MinWidth="360"
ui:TitleBar.IsIconVisible="False"
ui:WindowHelper.UseModernWindowStyle="True"
AutomationProperties.Name="{x:Static props:Resources.Grid_Layout_Editor}"
Background="{DynamicResource PrimaryBackgroundBrush}"
BorderThickness="0"
Closed="OnClosed"
ContentRendered="EditorWindow_ContentRendered"
ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
mc:Ignorable="d">
<Grid>
<Grid
Height="36"
Background="{DynamicResource SecondaryBackgroundBrush}"
Margin="0,-36,0,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
HorizontalAlignment="Stretch">
Background="{DynamicResource SecondaryBackgroundBrush}">
<Border
Background="{DynamicResource TitleBarSecondaryForegroundBrush}"
Width="30"
Height="3"
CornerRadius="1.5"
Margin="0,4,0,0"
VerticalAlignment="Center"
Margin="0,4,0,0" />
Background="{DynamicResource TitleBarSecondaryForegroundBrush}"
CornerRadius="1.5" />
</Grid>
<StackPanel Margin="16">
<StackPanel Margin="0,8,0,0">
<TextBlock
Focusable="True"
TextWrapping="Wrap">
<Run
FontWeight="Bold"
Text="{x:Static props:Resources.SplitterName}" />
<TextBlock Focusable="True" TextWrapping="Wrap">
<Run FontWeight="Bold" Text="{x:Static props:Resources.SplitterName}" />
<Run Text="{x:Static props:Resources.SplitterDescription}" />
</TextBlock>
<TextBlock
<TextBlock
Margin="0,8,0,0"
Focusable="True"
TextWrapping="Wrap">
<Run
FontWeight="Bold"
Text="{x:Static props:Resources.MergeName}" />
<Run FontWeight="Bold" Text="{x:Static props:Resources.MergeName}" />
<Run Text="{x:Static props:Resources.MergeDescription}" />
</TextBlock>
<TextBlock
<TextBlock
Margin="0,8,0,0"
Focusable="True"
TextWrapping="Wrap">
<Run
FontWeight="Bold"
Text="{x:Static props:Resources.KeyboardControlsName}" />
<Run FontWeight="Bold" Text="{x:Static props:Resources.KeyboardControlsName}" />
<Run Text="{x:Static props:Resources.KeyboardControlsDescription}" />
</TextBlock>
</StackPanel>
<Grid Margin="0,24,0,-36">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="8"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="8" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Content="{x:Static props:Resources.Cancel}"
Style="{StaticResource DefaultButtonStyle}"
HorizontalAlignment="Stretch"
TabIndex="1"
<Button
Grid.Column="2"
Click="OnCancel" />
<Button Content="{x:Static props:Resources.Save_Apply}"
Style="{StaticResource AccentButtonStyle}"
TabIndex="0"
HorizontalAlignment="Stretch"
Click="OnSaveApplyTemplate" />
Click="OnCancel"
Content="{x:Static props:Resources.Cancel}"
Style="{StaticResource DefaultButtonStyle}"
TabIndex="1" />
<Button
HorizontalAlignment="Stretch"
Click="OnSaveApplyTemplate"
Content="{x:Static props:Resources.Save_Apply}"
Style="{StaticResource AccentButtonStyle}"
TabIndex="0" />
</Grid>
</StackPanel>
</Grid>

View File

@ -1,46 +1,49 @@
<Thumb x:Class="FancyZonesEditor.GridResizer"
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:FancyZonesEditor"
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
mc:Ignorable="d"
Focusable="True"
AutomationProperties.Name="{x:Static props:Resources.Resizer_Thumb_Announce}"
d:DesignHeight="300" d:DesignWidth="300">
<Thumb
x:Class="FancyZonesEditor.GridResizer"
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:FancyZonesEditor"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
d:DesignHeight="300"
d:DesignWidth="300"
AutomationProperties.Name="{x:Static props:Resources.Resizer_Thumb_Announce}"
Focusable="True"
mc:Ignorable="d">
<Thumb.Template>
<ControlTemplate>
<Border x:Name="Body"
Height="48"
Width="48"
CornerRadius="48"
Background="{DynamicResource SystemControlBackgroundAccentBrush}">
<Border
x:Name="Body"
Width="48"
Height="48"
Background="{DynamicResource SystemControlBackgroundAccentBrush}"
CornerRadius="48">
<Border.Effect>
<DropShadowEffect BlurRadius="6"
Opacity="0.24"
ShadowDepth="1" />
<DropShadowEffect
BlurRadius="6"
Opacity="0.24"
ShadowDepth="1" />
</Border.Effect>
<Grid>
<Rectangle Height="20"
Width="2"
Fill="White"
Margin="5,0,0,0" />
<Rectangle Height="20"
Width="2"
Fill="White"
Margin="-5,0,0,0" />
<Rectangle
Width="2"
Height="20"
Margin="5,0,0,0"
Fill="White" />
<Rectangle
Width="2"
Height="20"
Margin="-5,0,0,0"
Fill="White" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background"
TargetName="Body"
Value="{DynamicResource SystemAccentColorLight1Brush}"/>
<Setter TargetName="Body" Property="Background" Value="{DynamicResource SystemAccentColorLight1Brush}" />
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter Property="Background" TargetName="Body"
Value="{DynamicResource SystemAccentColorLight3Brush}" />
<Setter TargetName="Body" Property="Background" Value="{DynamicResource SystemAccentColorLight3Brush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>

View File

@ -4,39 +4,39 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FancyZonesEditor"
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
xmlns:ui="http://schemas.modernwpf.com/2019"
d:DesignHeight="450"
d:DesignWidth="800"
ui:ControlHelper.CornerRadius="4"
Background="{DynamicResource GridZoneBackgroundBrush}"
BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}"
BorderThickness="1"
Opacity="1"
Focusable="True"
IsTabStop="True"
ui:ControlHelper.CornerRadius="4"
IsTabStop="True"
Opacity="1"
mc:Ignorable="d">
<Grid x:Name="Frame">
<Canvas x:Name="Body" />
<DockPanel HorizontalAlignment="Center"
VerticalAlignment="Center">
<DockPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<Label
Name="LabelID"
DockPanel.Dock="Top"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Content="ID"
DockPanel.Dock="Top"
FontSize="68"
FontWeight="SemiBold"
Foreground="{DynamicResource PrimaryForegroundBrush}" />
<TextBlock FontSize="16"
Foreground="{DynamicResource SecondaryForegroundBrush}"
FontWeight="SemiBold"
DockPanel.Dock="Bottom"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
DockPanel.Dock="Bottom"
FontSize="16"
FontWeight="SemiBold"
Foreground="{DynamicResource SecondaryForegroundBrush}">
<Run x:Name="WidthLabel" />
<Run Text="×" />
<Run x:Name="HeightLabel" />

View File

@ -1,16 +1,17 @@
<Window x:Class="FancyZonesEditor.LayoutOverlayWindow"
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:local="clr-namespace:FancyZonesEditor"
mc:Ignorable="d"
Title="FancyZones Layout"
Height="450"
Width="800"
ShowInTaskbar="False"
ResizeMode="NoResize"
WindowStyle="None"
AllowsTransparency="True"
Loaded="Window_Loaded"
Background="{DynamicResource BackdropBrush}"/>
<Window
x:Class="FancyZonesEditor.LayoutOverlayWindow"
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:FancyZonesEditor"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="FancyZones Layout"
Width="800"
Height="450"
AllowsTransparency="True"
Background="{DynamicResource BackdropBrush}"
Loaded="Window_Loaded"
ResizeMode="NoResize"
ShowInTaskbar="False"
WindowStyle="None"
mc:Ignorable="d" />

View File

@ -1,17 +1,16 @@
<UserControl x:Class="FancyZonesEditor.LayoutPreview"
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:FancyZonesEditor"
mc:Ignorable="d"
Loaded="OnLoaded"
d:DesignHeight="450"
d:DesignWidth="800">
<UserControl
x:Class="FancyZonesEditor.LayoutPreview"
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:FancyZonesEditor"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
Loaded="OnLoaded"
mc:Ignorable="d">
<Grid>
<Border CornerRadius="4"
Background="{DynamicResource LayoutPreviewBackgroundBrush}" />
<Grid x:Name="Body"
Background="Transparent" />
<Border Background="{DynamicResource LayoutPreviewBackgroundBrush}" CornerRadius="4" />
<Grid x:Name="Body" Background="Transparent" />
</Grid>
</UserControl>

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.modernwpf.com/2019">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.modernwpf.com/2019">
<Style x:Key="LayoutTypeRadioButtonStyle" TargetType="RadioButton">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Background" Value="{DynamicResource RadioButtonBackground}" />
@ -27,50 +28,50 @@
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="2"
SnapsToDevicePixels="True">
<Grid>
<Border
x:Name="CheckGlyph"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}"
BorderThickness="2"
CornerRadius="4"
Opacity="0"
UseLayoutRounding="False" />
<ui:ContentPresenterEx
x:Name="ContentPresenter"
Grid.Column="1"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
TextElement.Foreground="{TemplateBinding Foreground}"
TextWrapping="Wrap" />
</Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="CheckGlyph"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0" />
<DoubleAnimation
Storyboard.TargetName="CheckGlyph"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked" />
<VisualState x:Name="Indeterminate" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid>
<Border x:Name="CheckGlyph"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
UseLayoutRounding="False"
Opacity="0"
CornerRadius="4"
BorderThickness="2"
BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}" />
<ui:ContentPresenterEx x:Name="ContentPresenter"
TextElement.Foreground="{TemplateBinding Foreground}"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Grid.Column="1"
TextWrapping="Wrap"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="ContentPresenter"
Property="Foreground"
Value="{DynamicResource RadioButtonForegroundPointerOver}" />
<Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource RadioButtonForegroundPointerOver}" />
<Setter TargetName="CheckGlyph" Property="Opacity" Value="0.6" />
</Trigger>
@ -90,63 +91,48 @@
</Setter>
</Style>
<Style x:Key="IconOnlyButtonStyle"
BasedOn="{StaticResource DefaultButtonStyle}"
TargetType="Button">
<Setter Property="Background"
Value="Transparent" />
<Setter Property="Foreground"
Value="{DynamicResource ButtonForeground}" />
<Style
x:Key="IconOnlyButtonStyle"
BasedOn="{StaticResource DefaultButtonStyle}"
TargetType="Button">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Background"
Background="Transparent"
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
SnapsToDevicePixels="True">
<Border x:Name="Border"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
<ContentPresenter x:Name="ContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Border
x:Name="Background"
Background="Transparent"
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
SnapsToDevicePixels="True">
<Border
x:Name="Border"
Padding="{TemplateBinding Padding}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
<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 ButtonBackgroundPointerOver}" />
<Setter TargetName="Border"
Property="BorderBrush"
Value="{DynamicResource ButtonBorderBrushPointerOver}" />
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Background" Property="Background" Value="{DynamicResource ButtonBackgroundPointerOver}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushPointerOver}" />
</Trigger>
<Trigger Property="IsPressed"
Value="True">
<Setter TargetName="Background"
Property="Background"
Value="{DynamicResource ButtonBackgroundPressed}" />
<Setter TargetName="Border"
Property="BorderBrush"
Value="{DynamicResource ButtonBorderBrushPressed}" />
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Background" Property="Background" Value="{DynamicResource ButtonBackgroundPressed}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushPressed}" />
</Trigger>
<Trigger Property="IsEnabled"
Value="False">
<Setter TargetName="Background"
Property="Background"
Value="{DynamicResource ButtonBackgroundDisabled}" />
<Setter TargetName="Border"
Property="BorderBrush"
Value="{DynamicResource ButtonBorderBrushDisabled}" />
<Setter TargetName="ContentPresenter"
Property="TextElement.Foreground"
Value="{DynamicResource ButtonForegroundDisabled}" />
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Background" Property="Background" Value="{DynamicResource ButtonBackgroundDisabled}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushDisabled}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundDisabled}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>

View File

@ -1,135 +1,107 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.modernwpf.com/2019">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.modernwpf.com/2019">
<Style x:Key="UWPFocusVisualStyle">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Border Margin="-2"
CornerRadius="4"
BorderThickness="2"
BorderBrush="{DynamicResource PrimaryForegroundBrush}" />
<Border
Margin="-2"
BorderBrush="{DynamicResource PrimaryForegroundBrush}"
BorderThickness="2"
CornerRadius="4" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<DropShadowEffect x:Key="CardDropShadow"
BlurRadius="6"
Opacity="0.24"
ShadowDepth="1" />
<Style x:Key="MonitorItemContainerStyle"
TargetType="ui:GridViewItem">
<Setter Property="Background"
Value="{DynamicResource LayoutItemBackgroundBrush}" />
<Setter Property="IsSelected"
Value="{Binding Selected, Mode=OneWay}" />
<Setter Property="AutomationProperties.Name"
Value="{Binding Index}" />
<Setter Property="KeyboardNavigation.TabNavigation"
Value="Local" />
<Setter Property="MinWidth"
Value="0" />
<Setter Property="MinHeight"
Value="0" />
<DropShadowEffect
x:Key="CardDropShadow"
BlurRadius="6"
Opacity="0.24"
ShadowDepth="1" />
<Style x:Key="MonitorItemContainerStyle" TargetType="ui:GridViewItem">
<Setter Property="Background" Value="{DynamicResource LayoutItemBackgroundBrush}" />
<Setter Property="IsSelected" Value="{Binding Selected, Mode=OneWay}" />
<Setter Property="AutomationProperties.Name" Value="{Binding Index}" />
<Setter Property="KeyboardNavigation.TabNavigation" Value="Local" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="MinHeight" Value="0" />
<!--<Setter Property="IsHoldingEnabled" Value="True" />-->
<Setter Property="CornerRadius"
Value="4" />
<Setter Property="Margin"
Value="8" />
<Setter Property="UseSystemFocusVisuals"
Value="{DynamicResource UseSystemFocusVisuals}" />
<Setter Property="FocusVisualMargin"
Value="-2" />
<Setter Property="FocusVisualStyle"
Value="{DynamicResource UWPFocusVisualStyle}" />
<Setter Property="CornerRadius" Value="4" />
<Setter Property="Margin" Value="8" />
<Setter Property="UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
<Setter Property="FocusVisualMargin" Value="-2" />
<Setter Property="FocusVisualStyle" Value="{DynamicResource UWPFocusVisualStyle}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ui:GridViewItem">
<Border x:Name="ContentBorder"
Height="{Binding DisplayHeight}"
Width="{Binding DisplayWidth}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
Effect="{StaticResource CardDropShadow}">
<Border
x:Name="ContentBorder"
Width="{Binding DisplayWidth}"
Height="{Binding DisplayHeight}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Effect="{StaticResource CardDropShadow}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<VisualStateManager.CustomVisualStateManager>
<ui:SimpleVisualStateManager />
</VisualStateManager.CustomVisualStateManager>
<Grid>
<ContentPresenter x:Name="ContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Border x:Name="BorderRectangle"
IsHitTestVisible="False"
BorderBrush="{DynamicResource SystemControlHighlightListAccentLowBrush}"
BorderThickness="2"
CornerRadius="4"
Opacity="0" />
<ContentPresenter
x:Name="ContentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Border
x:Name="BorderRectangle"
BorderBrush="{DynamicResource SystemControlHighlightListAccentLowBrush}"
BorderThickness="2"
CornerRadius="4"
IsHitTestVisible="False"
Opacity="0" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<!-- Focused -->
<Trigger Property="ui:FocusVisualHelper.ShowFocusVisual"
Value="True">
<Setter TargetName="BorderRectangle"
Property="Visibility"
Value="Collapsed" />
<!-- Focused -->
<Trigger Property="ui:FocusVisualHelper.ShowFocusVisual" Value="True">
<Setter TargetName="BorderRectangle" Property="Visibility" Value="Collapsed" />
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Selected}"
Value="True" />
<Condition Binding="{Binding Selected}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter TargetName="ContentPresenter"
Property="TextElement.Foreground"
Value="{DynamicResource SystemControlHighlightAccentBrush}" />
<Setter TargetName="BorderRectangle"
Property="Opacity"
Value="1" />
<Setter TargetName="BorderRectangle"
Property="BorderBrush"
Value="{DynamicResource SystemControlHighlightAccentBrush}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource SystemControlHighlightAccentBrush}" />
<Setter TargetName="BorderRectangle" Property="Opacity" Value="1" />
<Setter TargetName="BorderRectangle" Property="BorderBrush" Value="{DynamicResource SystemControlHighlightAccentBrush}" />
</MultiDataTrigger>
<!-- PointerOver -->
<!-- PointerOver -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver"
Value="True" />
<Condition Property="IsSelected"
Value="False" />
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsSelected" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="BorderRectangle"
Property="Opacity"
Value="1" />
<Setter TargetName="BorderRectangle"
Property="BorderBrush"
Value="{DynamicResource SystemControlHighlightListLowBrush}" />
<Setter TargetName="ContentPresenter"
Property="TextElement.Foreground"
Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush"
Value="{DynamicResource SystemControlHighlightListLowBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness"
Value="2" />
<Setter TargetName="BorderRectangle" Property="Opacity" Value="1" />
<Setter TargetName="BorderRectangle" Property="BorderBrush" Value="{DynamicResource SystemControlHighlightListLowBrush}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush" Value="{DynamicResource SystemControlHighlightListLowBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness" Value="2" />
</MultiTrigger>
<!-- Selected -->
<!-- Selected -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver"
Value="False" />
<Condition Property="IsSelected"
Value="True" />
<Condition Property="IsMouseOver" Value="False" />
<Condition Property="IsSelected" Value="True" />
</MultiTrigger.Conditions>
<!--<Setter TargetName="BorderRectangle"
@ -147,143 +119,103 @@
Value="2" />-->
</MultiTrigger>
<!-- PointerOverSelected -->
<!-- PointerOverSelected -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver"
Value="True" />
<Condition Property="IsSelected"
Value="True" />
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsSelected" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="BorderRectangle"
Property="Opacity"
Value="1" />
<Setter TargetName="BorderRectangle"
Property="BorderBrush"
Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush"
Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness"
Value="2" />
<Setter TargetName="BorderRectangle" Property="Opacity" Value="1" />
<Setter TargetName="BorderRectangle" Property="BorderBrush" Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush" Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness" Value="2" />
</MultiTrigger>
<!-- Disabled -->
<Trigger Property="IsEnabled"
Value="False">
<Setter TargetName="ContentBorder"
Property="Opacity"
Value="{DynamicResource ListViewItemDisabledThemeOpacity}" />
<!-- Disabled -->
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="ContentBorder" Property="Opacity" Value="{DynamicResource ListViewItemDisabledThemeOpacity}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="LayoutItemContainerStyle"
TargetType="ui:GridViewItem">
<Setter Property="Background"
Value="{DynamicResource LayoutItemBackgroundBrush}" />
<Setter Property="IsSelected"
Value="{Binding IsApplied, Mode=OneWay}" />
<Setter Property="AutomationProperties.Name"
Value="{Binding Name}" />
<Setter Property="KeyboardNavigation.TabNavigation"
Value="Local" />
<Style x:Key="LayoutItemContainerStyle" TargetType="ui:GridViewItem">
<Setter Property="Background" Value="{DynamicResource LayoutItemBackgroundBrush}" />
<Setter Property="IsSelected" Value="{Binding IsApplied, Mode=OneWay}" />
<Setter Property="AutomationProperties.Name" Value="{Binding Name}" />
<Setter Property="KeyboardNavigation.TabNavigation" Value="Local" />
<!--<Setter Property="IsHoldingEnabled" Value="True" />-->
<Setter Property="CornerRadius"
Value="4" />
<Setter Property="Margin"
Value="8" />
<Setter Property="UseSystemFocusVisuals"
Value="{DynamicResource UseSystemFocusVisuals}" />
<Setter Property="FocusVisualMargin"
Value="-2" />
<Setter Property="FocusVisualStyle"
Value="{DynamicResource UWPFocusVisualStyle}" />
<Setter Property="CornerRadius" Value="4" />
<Setter Property="Margin" Value="8" />
<Setter Property="UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
<Setter Property="FocusVisualMargin" Value="-2" />
<Setter Property="FocusVisualStyle" Value="{DynamicResource UWPFocusVisualStyle}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ui:GridViewItem">
<Border x:Name="ContentBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
Effect="{StaticResource CardDropShadow}">
<Border
x:Name="ContentBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Effect="{StaticResource CardDropShadow}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<VisualStateManager.CustomVisualStateManager>
<ui:SimpleVisualStateManager />
</VisualStateManager.CustomVisualStateManager>
<Grid>
<ContentPresenter x:Name="ContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Border x:Name="BorderRectangle"
IsHitTestVisible="False"
BorderBrush="{DynamicResource SystemControlHighlightListAccentLowBrush}"
BorderThickness="2"
CornerRadius="4"
Opacity="0" />
<ContentPresenter
x:Name="ContentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Border
x:Name="BorderRectangle"
BorderBrush="{DynamicResource SystemControlHighlightListAccentLowBrush}"
BorderThickness="2"
CornerRadius="4"
IsHitTestVisible="False"
Opacity="0" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<!-- Focused -->
<Trigger Property="ui:FocusVisualHelper.ShowFocusVisual"
Value="True">
<Setter TargetName="BorderRectangle"
Property="Visibility"
Value="Collapsed" />
<!-- Focused -->
<Trigger Property="ui:FocusVisualHelper.ShowFocusVisual" Value="True">
<Setter TargetName="BorderRectangle" Property="Visibility" Value="Collapsed" />
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsApplied}"
Value="True" />
<Condition Binding="{Binding IsApplied}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter TargetName="ContentPresenter"
Property="TextElement.Foreground"
Value="{DynamicResource SystemControlHighlightAccentBrush}" />
<Setter TargetName="BorderRectangle"
Property="Opacity"
Value="1" />
<Setter TargetName="BorderRectangle"
Property="BorderBrush"
Value="{DynamicResource SystemControlHighlightAccentBrush}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource SystemControlHighlightAccentBrush}" />
<Setter TargetName="BorderRectangle" Property="Opacity" Value="1" />
<Setter TargetName="BorderRectangle" Property="BorderBrush" Value="{DynamicResource SystemControlHighlightAccentBrush}" />
</MultiDataTrigger>
<!-- PointerOver -->
<!-- PointerOver -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver"
Value="True" />
<Condition Property="IsSelected"
Value="False" />
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsSelected" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="BorderRectangle"
Property="Opacity"
Value="1" />
<Setter TargetName="BorderRectangle"
Property="BorderBrush"
Value="{DynamicResource SystemControlHighlightListLowBrush}" />
<Setter TargetName="ContentPresenter"
Property="TextElement.Foreground"
Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush"
Value="{DynamicResource SystemControlHighlightListLowBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness"
Value="2" />
<Setter TargetName="BorderRectangle" Property="Opacity" Value="1" />
<Setter TargetName="BorderRectangle" Property="BorderBrush" Value="{DynamicResource SystemControlHighlightListLowBrush}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush" Value="{DynamicResource SystemControlHighlightListLowBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness" Value="2" />
</MultiTrigger>
<!-- Selected -->
<!-- Selected -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver"
Value="False" />
<Condition Property="IsSelected"
Value="True" />
<Condition Property="IsMouseOver" Value="False" />
<Condition Property="IsSelected" Value="True" />
</MultiTrigger.Conditions>
<!--<Setter TargetName="BorderRectangle"
@ -301,33 +233,22 @@
Value="2" />-->
</MultiTrigger>
<!-- PointerOverSelected -->
<!-- PointerOverSelected -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver"
Value="True" />
<Condition Property="IsSelected"
Value="True" />
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsSelected" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="BorderRectangle"
Property="Opacity"
Value="1" />
<Setter TargetName="BorderRectangle"
Property="BorderBrush"
Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush"
Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness"
Value="2" />
<Setter TargetName="BorderRectangle" Property="Opacity" Value="1" />
<Setter TargetName="BorderRectangle" Property="BorderBrush" Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryBrush" Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
<Setter Property="ui:FocusVisualHelper.FocusVisualSecondaryThickness" Value="2" />
</MultiTrigger>
<!-- Disabled -->
<Trigger Property="IsEnabled"
Value="False">
<Setter TargetName="ContentBorder"
Property="Opacity"
Value="{DynamicResource ListViewItemDisabledThemeOpacity}" />
<!-- Disabled -->
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="ContentBorder" Property="Opacity" Value="{DynamicResource ListViewItemDisabledThemeOpacity}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>

View File

@ -1,9 +1,14 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:local="clr-namespace:FancyZonesEditor.Styles">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FancyZonesEditor.Styles"
xmlns:ui="http://schemas.modernwpf.com/2019">
<DropShadowEffect x:Key="ZoneDropShadow" BlurRadius="16" Opacity="0.28" ShadowDepth="1" />
<DropShadowEffect
x:Key="ZoneDropShadow"
BlurRadius="16"
Opacity="0.28"
ShadowDepth="1" />
<Style x:Key="GridLayoutSmallScalePreviewStyle" TargetType="Border">
<Setter Property="Background" Value="{DynamicResource LayoutPreviewSmallScaleZoneBackgroundBrush}" />

View File

@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata -->
<system:String x:Key="Theme.Name">Dark.Accent1</system:String>
@ -9,7 +10,7 @@
<system:String x:Key="Theme.BaseColorScheme">Dark</system:String>
<system:String x:Key="Theme.ColorScheme">Accent1</system:String>
<Color x:Key="Theme.PrimaryAccentColor">Black</Color>
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FF242424" />
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FF1c1c1c" />
<SolidColorBrush x:Key="TertiaryBackgroundBrush" Color="#FF202020" />
@ -17,14 +18,14 @@
<SolidColorBrush x:Key="SecondaryForegroundBrush" Color="#FF9a9a9a" />
<SolidColorBrush x:Key="BackdropBrush" Color="#40F0F0F0" />
<SolidColorBrush x:Key="TitleBarSecondaryForegroundBrush" Color="#FF9a9a9a" />
<!-- Used for layouts and monitors -->
<!-- Used for layouts and monitors -->
<SolidColorBrush x:Key="LayoutItemBackgroundBrush" Color="#FF3A3A3A" />
<SolidColorBrush x:Key="LayoutItemBackgroundPointerOverBrush" Color="#FF333333" />
<!-- Used for the fullscreen preview (ActualScale) and for the thumbnail preview (SmallScale) -->
<!-- Used for the fullscreen preview (ActualScale) and for the thumbnail preview (SmallScale) -->
<SolidColorBrush x:Key="LayoutPreviewBackgroundBrush" Color="#331B1B1B" />
<!-- Currently unused -->
<!-- Currently unused -->
<SolidColorBrush x:Key="LayoutPreviewZoneBorderBrush" Color="#FF555454" />
<SolidColorBrush x:Key="LayoutPreviewActualScaleZoneBackgroundBrush" Color="#B0202020" />

View File

@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent2</system:String>

View File

@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent3</system:String>

View File

@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent4</system:String>

View File

@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent5</system:String>
@ -21,7 +22,7 @@
<SolidColorBrush x:Key="LayoutItemBackgroundPointerOverBrush" Color="#FFf2f2f2" />
<SolidColorBrush x:Key="LayoutPreviewBackgroundBrush" Color="#19949494" />
<SolidColorBrush x:Key="LayoutPreviewZoneBorderBrush" Color="#9c9c9c" />
<SolidColorBrush x:Key="LayoutPreviewActualScaleZoneBackgroundBrush" Color="#EFF3F3F3" />
<SolidColorBrush x:Key="LayoutPreviewSmallScaleZoneBackgroundBrush" Color="#FFDCDCDC" />
<SolidColorBrush x:Key="CanvasZoneBackgroundBrush" Color="#E5F3F3F3" />

View File

@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata -->
<system:String x:Key="Theme.Name">Light.Accent1</system:String>
@ -18,18 +19,18 @@
<SolidColorBrush x:Key="BackdropBrush" Color="#85F0F0F0" />
<SolidColorBrush x:Key="TitleBarSecondaryForegroundBrush" Color="#FF949494" />
<!-- Used for layouts and monitors -->
<SolidColorBrush x:Key="LayoutItemBackgroundBrush" Color="#FFffffff"/>
<!-- Used for layouts and monitors -->
<SolidColorBrush x:Key="LayoutItemBackgroundBrush" Color="#FFffffff" />
<SolidColorBrush x:Key="LayoutItemBackgroundPointerOverBrush" Color="#FFf2f2f2" />
<!-- Used for the fullscreen preview (ActualScale) and for the thumbnail preview (SmallScale) -->
<!-- Used for the fullscreen preview (ActualScale) and for the thumbnail preview (SmallScale) -->
<SolidColorBrush x:Key="LayoutPreviewBackgroundBrush" Color="#19949494" />
<!-- Currently unused -->
<!-- Currently unused -->
<SolidColorBrush x:Key="LayoutPreviewZoneBorderBrush" Color="#FFC3BEBE" />
<SolidColorBrush x:Key="LayoutPreviewActualScaleZoneBackgroundBrush" Color="#C5F8F8F8" />
<SolidColorBrush x:Key="LayoutPreviewSmallScaleZoneBackgroundBrush" Color="#FFDCDCDC" />
<SolidColorBrush x:Key="CanvasZoneBackgroundBrush" Color="#C5F8F8F8" />
<SolidColorBrush x:Key="CanvasZoneBorderBrush" Color="#CC000000" />
<SolidColorBrush x:Key="GridZoneBackgroundBrush" Color="#C5F8F8F8" />

View File

@ -43,24 +43,28 @@ namespace Microsoft.Plugin.Shell
{
new PluginAdditionalOption()
{
Key = "LeaveShellOpen",
DisplayLabel = Resources.wox_leave_shell_open,
Value = _settings.LeaveShellOpen,
Key = "ShellCommandExecution",
DisplayLabel = Resources.wox_shell_command_execution,
DisplayDescription = Resources.wox_shell_command_execution_description,
PluginOptionType = PluginAdditionalOption.AdditionalOptionType.Combobox,
ComboBoxItems = new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>(Resources.find_executable_file_and_run_it, "2"),
new KeyValuePair<string, string>(Resources.run_command_in_command_prompt, "0"),
new KeyValuePair<string, string>(Resources.run_command_in_powershell, "1"),
new KeyValuePair<string, string>(Resources.run_command_in_powershell_seven, "6"),
new KeyValuePair<string, string>(Resources.run_command_in_windows_terminal_cmd, "5"),
new KeyValuePair<string, string>(Resources.run_command_in_windows_terminal_powershell, "3"),
new KeyValuePair<string, string>(Resources.run_command_in_windows_terminal_powershell_seven, "4"),
},
ComboBoxValue = (int)_settings.Shell,
},
new PluginAdditionalOption()
{
Key = "ShellCommandExecution",
DisplayLabel = Resources.wox_shell_command_execution,
PluginOptionType = PluginAdditionalOption.AdditionalOptionType.Combobox,
ComboBoxOptions = new List<string>
{
Resources.run_command_in_command_prompt,
Resources.run_command_in_powershell,
Resources.find_executable_file_and_run_it,
Resources.run_command_in_windows_terminal,
},
ComboBoxValue = (int)_settings.Shell,
Key = "LeaveShellOpen",
DisplayLabel = Resources.wox_leave_shell_open,
Value = _settings.LeaveShellOpen,
},
};
@ -209,21 +213,63 @@ namespace Microsoft.Plugin.Shell
}
else
{
arguments = $"\"{command} ; Read-Host -Prompt \\\"Press Enter to continue\\\"\"";
arguments = $"\"{command} ; Read-Host -Prompt \\\"{Resources.run_plugin_cmd_wait_message}\\\"\"";
}
info = ShellCommand.SetProcessStartInfo("powershell.exe", workingDirectory, arguments, runAsVerbArg);
}
else if (_settings.Shell == ExecutionShell.WindowsTerminal)
else if (_settings.Shell == ExecutionShell.PowerShellSeven)
{
string arguments;
if (_settings.LeaveShellOpen)
{
arguments = $"powershell -NoExit \"{command}\"";
arguments = $"-NoExit -C \"{command}\"";
}
else
{
arguments = $"powershell \"{command}\"";
arguments = $"-C \"{command} ; Read-Host -Prompt \\\"{Resources.run_plugin_cmd_wait_message}\\\"\"";
}
info = ShellCommand.SetProcessStartInfo("pwsh.exe", workingDirectory, arguments, runAsVerbArg);
}
else if (_settings.Shell == ExecutionShell.WindowsTerminalCmd)
{
string arguments;
if (_settings.LeaveShellOpen)
{
arguments = $"cmd.exe /k \"{command}\"";
}
else
{
arguments = $"cmd.exe /c \"{command}\" & pause";
}
info = ShellCommand.SetProcessStartInfo("wt.exe", workingDirectory, arguments, runAsVerbArg);
}
else if (_settings.Shell == ExecutionShell.WindowsTerminalPowerShell)
{
string arguments;
if (_settings.LeaveShellOpen)
{
arguments = $"powershell -NoExit -C \"{command}\"";
}
else
{
arguments = $"powershell -C \"{command}\"";
}
info = ShellCommand.SetProcessStartInfo("wt.exe", workingDirectory, arguments, runAsVerbArg);
}
else if (_settings.Shell == ExecutionShell.WindowsTerminalPowerShellSeven)
{
string arguments;
if (_settings.LeaveShellOpen)
{
arguments = $"pwsh.exe -NoExit -C \"{command}\"";
}
else
{
arguments = $"pwsh.exe -C \"{command}\"";
}
info = ShellCommand.SetProcessStartInfo("wt.exe", workingDirectory, arguments, runAsVerbArg);

View File

@ -61,7 +61,7 @@ namespace Microsoft.Plugin.Shell.Properties {
}
/// <summary>
/// Looks up a localized string similar to Find executable file and run it.
/// Looks up a localized string similar to Find and run executable file.
/// </summary>
public static string find_executable_file_and_run_it {
get {
@ -70,7 +70,7 @@ namespace Microsoft.Plugin.Shell.Properties {
}
/// <summary>
/// Looks up a localized string similar to Run command in Command Prompt (cmd.exe).
/// Looks up a localized string similar to Run in Command Prompt (cmd.exe).
/// </summary>
public static string run_command_in_command_prompt {
get {
@ -79,7 +79,7 @@ namespace Microsoft.Plugin.Shell.Properties {
}
/// <summary>
/// Looks up a localized string similar to Run command in PowerShell (PowerShell.exe).
/// Looks up a localized string similar to Run in PowerShell (PowerShell.exe).
/// </summary>
public static string run_command_in_powershell {
get {
@ -88,11 +88,47 @@ namespace Microsoft.Plugin.Shell.Properties {
}
/// <summary>
/// Looks up a localized string similar to Run command in Windows Terminal (wt.exe).
/// Looks up a localized string similar to Run in PowerShell 7 (pwsh.exe).
/// </summary>
public static string run_command_in_windows_terminal {
public static string run_command_in_powershell_seven {
get {
return ResourceManager.GetString("run_command_in_windows_terminal", resourceCulture);
return ResourceManager.GetString("run_command_in_powershell_seven", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Run in Command Prompt (cmd.exe) using Windows Terminal.
/// </summary>
public static string run_command_in_windows_terminal_cmd {
get {
return ResourceManager.GetString("run_command_in_windows_terminal_cmd", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Run in PowerShell (PowerShell.exe) using Windows Terminal.
/// </summary>
public static string run_command_in_windows_terminal_powershell {
get {
return ResourceManager.GetString("run_command_in_windows_terminal_powershell", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Run in PowerShell 7 (pwsh.exe) using Windows Terminal.
/// </summary>
public static string run_command_in_windows_terminal_powershell_seven {
get {
return ResourceManager.GetString("run_command_in_windows_terminal_powershell_seven", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Press Enter to continue.
/// </summary>
public static string run_plugin_cmd_wait_message {
get {
return ResourceManager.GetString("run_plugin_cmd_wait_message", resourceCulture);
}
}
@ -178,12 +214,21 @@ namespace Microsoft.Plugin.Shell.Properties {
}
/// <summary>
/// Looks up a localized string similar to Shell command execution.
/// Looks up a localized string similar to Command execution.
/// </summary>
public static string wox_shell_command_execution {
get {
return ResourceManager.GetString("wox_shell_command_execution", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to All entries that using the Windows Terminal forcing the Windows Terminal as console host regardless of the system setting.
/// </summary>
public static string wox_shell_command_execution_description {
get {
return ResourceManager.GetString("wox_shell_command_execution_description", resourceCulture);
}
}
}
}

View File

@ -145,18 +145,34 @@
<value>Keep shell open</value>
</data>
<data name="wox_shell_command_execution" xml:space="preserve">
<value>Shell command execution</value>
<value>Command execution</value>
</data>
<data name="run_command_in_command_prompt" xml:space="preserve">
<value>Run command in Command Prompt (cmd.exe)</value>
<value>Run in Command Prompt (cmd.exe)</value>
</data>
<data name="run_command_in_powershell" xml:space="preserve">
<value>Run command in PowerShell (PowerShell.exe)</value>
<value>Run in PowerShell (PowerShell.exe)</value>
</data>
<data name="find_executable_file_and_run_it" xml:space="preserve">
<value>Find executable file and run it</value>
<value>Find and run the executable file</value>
</data>
<data name="run_command_in_windows_terminal" xml:space="preserve">
<value>Run command in Windows Terminal (wt.exe)</value>
<data name="run_command_in_powershell_seven" xml:space="preserve">
<value>Run in PowerShell 7 (pwsh.exe)</value>
</data>
<data name="run_command_in_windows_terminal_cmd" xml:space="preserve">
<value>Run in Command Prompt (cmd.exe) using Windows Terminal</value>
</data>
<data name="run_command_in_windows_terminal_powershell" xml:space="preserve">
<value>Run in PowerShell (PowerShell.exe) using Windows Terminal</value>
</data>
<data name="run_command_in_windows_terminal_powershell_seven" xml:space="preserve">
<value>Run in PowerShell 7 (pwsh.exe) using Windows Terminal</value>
</data>
<data name="run_plugin_cmd_wait_message" xml:space="preserve">
<value>Press Enter to continue</value>
<comment>"Enter" means the Enter key on the keyboard.</comment>
</data>
<data name="wox_shell_command_execution_description" xml:space="preserve">
<value>All entries using the Windows Terminal force the Windows Terminal as the console host regardless of the system settings</value>
</data>
</root>

View File

@ -41,6 +41,9 @@ namespace Microsoft.Plugin.Shell
Cmd = 0,
Powershell = 1,
RunCommand = 2,
WindowsTerminal = 3,
WindowsTerminalPowerShell = 3,
WindowsTerminalPowerShellSeven = 4,
WindowsTerminalCmd = 5,
PowerShellSeven = 6,
}
}

View File

@ -54,8 +54,13 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public int ComboBoxValue { get; set; }
/// <summary>
/// Gets or sets the list of dropdown items for the ComboBox. Please use the item name as Key and an integer as Value.
/// The value gets converted in settings UI to an integer and will be saved in <see cref="ComboBoxValue"/>.
/// You can define the visibility order in settings ui by arranging the list items.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string> ComboBoxOptions { get; set; }
public List<KeyValuePair<string, string>> ComboBoxItems { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string TextValue { get; set; }
@ -91,5 +96,15 @@ namespace Microsoft.PowerToys.Settings.UI.Library
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? NumberBoxLargeChange { get; set; }
// Outdated properties kept for backward compatibility with third-party plugins. (They are only required to not have old third-party plugins crashing when propagating their plugin options.)
#pragma warning disable SA1623 // Property summary documentation should match accessors
/// <summary>
/// PLEASE DON'T USE ANYMORE!! (The property was used for the list of combobox items in the past and is not functional anymore.)
/// </summary>
[JsonIgnore]
public List<string> ComboBoxOptions { get; set; }
#pragma warning restore SA1623 // Property summary documentation should match accessors
}
}

View File

@ -153,12 +153,8 @@
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.TabSelectsContextButtons, Mode=TwoWay}" />
</controls:SettingsCard>
<controls:SettingsCard
x:Uid="PowerLauncher_UsePinyin"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xE98A;}">
<ToggleSwitch
x:Uid="ToggleSwitch"
IsOn="{x:Bind ViewModel.UsePinyin, Mode=TwoWay}" />
<controls:SettingsCard x:Uid="PowerLauncher_UsePinyin" HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xE98A;}">
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.UsePinyin, Mode=TwoWay}" />
</controls:SettingsCard>
<controls:SettingsCard x:Uid="PowerLauncher_GenerateThumbnailsFromFiles">
@ -388,8 +384,10 @@
Visibility="{x:Bind Path=ShowComboBox, Converter={StaticResource BoolToVisibilityConverter}}">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
ItemsSource="{x:Bind Path=ComboBoxOptions}"
SelectedIndex="{x:Bind Path=ComboBoxValue, Mode=TwoWay}" />
DisplayMemberPath="Key"
ItemsSource="{x:Bind Path=ComboBoxItems}"
SelectedValue="{x:Bind Path=ComboBoxValue, Mode=TwoWay}"
SelectedValuePath="Value" />
</controls:SettingsCard>
<!-- TextBox setting -->
<controls:SettingsCard
@ -456,8 +454,10 @@
IsEnabled="{x:Bind Path=SecondSettingIsEnabled, Mode=OneWay}">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
ItemsSource="{x:Bind Path=ComboBoxOptions}"
SelectedIndex="{x:Bind Path=ComboBoxValue, Mode=TwoWay}" />
DisplayMemberPath="Key"
ItemsSource="{x:Bind Path=ComboBoxItems}"
SelectedValue="{x:Bind Path=ComboBoxValue, Mode=TwoWay}"
SelectedValuePath="Value" />
</controls:SettingsCard>
</StackPanel>
<!-- Checkbox And TextBox setting -->

View File

@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.CompilerServices;
using Microsoft.PowerToys.Settings.UI.Library;
@ -47,18 +48,18 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
// ComboBox setting
public bool ShowComboBox => _additionalOption.PluginOptionType == PluginAdditionalOption.AdditionalOptionType.Combobox &&
_additionalOption.ComboBoxOptions != null && _additionalOption.ComboBoxOptions.Count > 0;
_additionalOption.ComboBoxItems != null && _additionalOption.ComboBoxItems.Count > 0;
public List<string> ComboBoxOptions => _additionalOption.ComboBoxOptions;
public List<KeyValuePair<string, string>> ComboBoxItems => _additionalOption.ComboBoxItems;
public int ComboBoxValue
public string ComboBoxValue
{
get => _additionalOption.ComboBoxValue;
get => _additionalOption.ComboBoxValue.ToString(CultureInfo.InvariantCulture);
set
{
if (value != _additionalOption.ComboBoxValue)
if (int.Parse(value, CultureInfo.InvariantCulture) != _additionalOption.ComboBoxValue)
{
_additionalOption.ComboBoxValue = value;
_additionalOption.ComboBoxValue = int.Parse(value, CultureInfo.InvariantCulture);
NotifyPropertyChanged();
}
}