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 else
{ {
Write-Output "Checking all files (passively)" 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) if ($files.count -gt 0)
{ {

View File

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

View File

@ -1,13 +1,15 @@
<UserControl x:Class="FancyZonesEditor.CanvasEditor" <UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="FancyZonesEditor.CanvasEditor"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="300" d:DesignWidth="300"> d:DesignHeight="300"
d:DesignWidth="300"
mc:Ignorable="d">
<Grid x:Name="Body"> <Grid x:Name="Body">
<Viewbox Stretch="Uniform"> <Viewbox Stretch="Uniform">
<Canvas x:Name="Preview"/> <Canvas x:Name="Preview" />
</Viewbox> </Viewbox>
</Grid> </Grid>
</UserControl> </UserControl>

View File

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

View File

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

View File

@ -1,9 +1,10 @@
<Button x:Class="FancyZonesEditor.ClickAutomationEventButton" <Button
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="FancyZonesEditor.ClickAutomationEventButton"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FancyZonesEditor" xmlns:local="clr-namespace:FancyZonesEditor"
mc:Ignorable="d" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450"
</Button> d:DesignWidth="800"
mc:Ignorable="d" />

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,17 +1,16 @@
<UserControl x:Class="FancyZonesEditor.LayoutPreview" <UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="FancyZonesEditor.LayoutPreview"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FancyZonesEditor" xmlns:local="clr-namespace:FancyZonesEditor"
mc:Ignorable="d" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Loaded="OnLoaded" d:DesignHeight="450"
d:DesignHeight="450" d:DesignWidth="800"
d:DesignWidth="800"> Loaded="OnLoaded"
mc:Ignorable="d">
<Grid> <Grid>
<Border CornerRadius="4" <Border Background="{DynamicResource LayoutPreviewBackgroundBrush}" CornerRadius="4" />
Background="{DynamicResource LayoutPreviewBackgroundBrush}" /> <Grid x:Name="Body" Background="Transparent" />
<Grid x:Name="Body"
Background="Transparent" />
</Grid> </Grid>
</UserControl> </UserControl>

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

@ -1,9 +1,14 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FancyZonesEditor.Styles"> 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"> <Style x:Key="GridLayoutSmallScalePreviewStyle" TargetType="Border">
<Setter Property="Background" Value="{DynamicResource LayoutPreviewSmallScaleZoneBackgroundBrush}" /> <Setter Property="Background" Value="{DynamicResource LayoutPreviewSmallScaleZoneBackgroundBrush}" />

View File

@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:system="clr-namespace:System;assembly=System.Runtime"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata --> <!-- Metadata -->
<system:String x:Key="Theme.Name">Dark.Accent1</system:String> <system:String x:Key="Theme.Name">Dark.Accent1</system:String>
@ -18,13 +19,13 @@
<SolidColorBrush x:Key="BackdropBrush" Color="#40F0F0F0" /> <SolidColorBrush x:Key="BackdropBrush" Color="#40F0F0F0" />
<SolidColorBrush x:Key="TitleBarSecondaryForegroundBrush" Color="#FF9a9a9a" /> <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="LayoutItemBackgroundBrush" Color="#FF3A3A3A" />
<SolidColorBrush x:Key="LayoutItemBackgroundPointerOverBrush" Color="#FF333333" /> <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" /> <SolidColorBrush x:Key="LayoutPreviewBackgroundBrush" Color="#331B1B1B" />
<!-- Currently unused --> <!-- Currently unused -->
<SolidColorBrush x:Key="LayoutPreviewZoneBorderBrush" Color="#FF555454" /> <SolidColorBrush x:Key="LayoutPreviewZoneBorderBrush" Color="#FF555454" />
<SolidColorBrush x:Key="LayoutPreviewActualScaleZoneBackgroundBrush" Color="#B0202020" /> <SolidColorBrush x:Key="LayoutPreviewActualScaleZoneBackgroundBrush" Color="#B0202020" />

View File

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

View File

@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:system="clr-namespace:System;assembly=System.Runtime"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata --> <!-- Metadata -->
<system:String x:Key="Theme.Name">Light.Accent1</system:String> <system:String x:Key="Theme.Name">Light.Accent1</system:String>
@ -18,13 +19,13 @@
<SolidColorBrush x:Key="BackdropBrush" Color="#85F0F0F0" /> <SolidColorBrush x:Key="BackdropBrush" Color="#85F0F0F0" />
<SolidColorBrush x:Key="TitleBarSecondaryForegroundBrush" Color="#FF949494" /> <SolidColorBrush x:Key="TitleBarSecondaryForegroundBrush" Color="#FF949494" />
<!-- Used for layouts and monitors --> <!-- Used for layouts and monitors -->
<SolidColorBrush x:Key="LayoutItemBackgroundBrush" Color="#FFffffff"/> <SolidColorBrush x:Key="LayoutItemBackgroundBrush" Color="#FFffffff" />
<SolidColorBrush x:Key="LayoutItemBackgroundPointerOverBrush" Color="#FFf2f2f2" /> <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" /> <SolidColorBrush x:Key="LayoutPreviewBackgroundBrush" Color="#19949494" />
<!-- Currently unused --> <!-- Currently unused -->
<SolidColorBrush x:Key="LayoutPreviewZoneBorderBrush" Color="#FFC3BEBE" /> <SolidColorBrush x:Key="LayoutPreviewZoneBorderBrush" Color="#FFC3BEBE" />
<SolidColorBrush x:Key="LayoutPreviewActualScaleZoneBackgroundBrush" Color="#C5F8F8F8" /> <SolidColorBrush x:Key="LayoutPreviewActualScaleZoneBackgroundBrush" Color="#C5F8F8F8" />

View File

@ -43,24 +43,28 @@ namespace Microsoft.Plugin.Shell
{ {
new PluginAdditionalOption() new PluginAdditionalOption()
{ {
Key = "LeaveShellOpen", Key = "ShellCommandExecution",
DisplayLabel = Resources.wox_leave_shell_open, DisplayLabel = Resources.wox_shell_command_execution,
Value = _settings.LeaveShellOpen, 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() new PluginAdditionalOption()
{ {
Key = "ShellCommandExecution", Key = "LeaveShellOpen",
DisplayLabel = Resources.wox_shell_command_execution, DisplayLabel = Resources.wox_leave_shell_open,
PluginOptionType = PluginAdditionalOption.AdditionalOptionType.Combobox, Value = _settings.LeaveShellOpen,
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,
}, },
}; };
@ -209,21 +213,63 @@ namespace Microsoft.Plugin.Shell
} }
else 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); info = ShellCommand.SetProcessStartInfo("powershell.exe", workingDirectory, arguments, runAsVerbArg);
} }
else if (_settings.Shell == ExecutionShell.WindowsTerminal) else if (_settings.Shell == ExecutionShell.PowerShellSeven)
{ {
string arguments; string arguments;
if (_settings.LeaveShellOpen) if (_settings.LeaveShellOpen)
{ {
arguments = $"powershell -NoExit \"{command}\""; arguments = $"-NoExit -C \"{command}\"";
} }
else 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); info = ShellCommand.SetProcessStartInfo("wt.exe", workingDirectory, arguments, runAsVerbArg);

View File

@ -61,7 +61,7 @@ namespace Microsoft.Plugin.Shell.Properties {
} }
/// <summary> /// <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> /// </summary>
public static string find_executable_file_and_run_it { public static string find_executable_file_and_run_it {
get { get {
@ -70,7 +70,7 @@ namespace Microsoft.Plugin.Shell.Properties {
} }
/// <summary> /// <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> /// </summary>
public static string run_command_in_command_prompt { public static string run_command_in_command_prompt {
get { get {
@ -79,7 +79,7 @@ namespace Microsoft.Plugin.Shell.Properties {
} }
/// <summary> /// <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> /// </summary>
public static string run_command_in_powershell { public static string run_command_in_powershell {
get { get {
@ -88,11 +88,47 @@ namespace Microsoft.Plugin.Shell.Properties {
} }
/// <summary> /// <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> /// </summary>
public static string run_command_in_windows_terminal { public static string run_command_in_powershell_seven {
get { 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> /// <summary>
/// Looks up a localized string similar to Shell command execution. /// Looks up a localized string similar to Command execution.
/// </summary> /// </summary>
public static string wox_shell_command_execution { public static string wox_shell_command_execution {
get { get {
return ResourceManager.GetString("wox_shell_command_execution", resourceCulture); 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> <value>Keep shell open</value>
</data> </data>
<data name="wox_shell_command_execution" xml:space="preserve"> <data name="wox_shell_command_execution" xml:space="preserve">
<value>Shell command execution</value> <value>Command execution</value>
</data> </data>
<data name="run_command_in_command_prompt" xml:space="preserve"> <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>
<data name="run_command_in_powershell" xml:space="preserve"> <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>
<data name="find_executable_file_and_run_it" xml:space="preserve"> <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>
<data name="run_command_in_windows_terminal" xml:space="preserve"> <data name="run_command_in_powershell_seven" xml:space="preserve">
<value>Run command in Windows Terminal (wt.exe)</value> <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> </data>
</root> </root>

View File

@ -41,6 +41,9 @@ namespace Microsoft.Plugin.Shell
Cmd = 0, Cmd = 0,
Powershell = 1, Powershell = 1,
RunCommand = 2, 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; } 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)] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string> ComboBoxOptions { get; set; } public List<KeyValuePair<string, string>> ComboBoxItems { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string TextValue { get; set; } public string TextValue { get; set; }
@ -91,5 +96,15 @@ namespace Microsoft.PowerToys.Settings.UI.Library
/// </summary> /// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? NumberBoxLargeChange { get; set; } 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}" /> <ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.TabSelectsContextButtons, Mode=TwoWay}" />
</controls:SettingsCard> </controls:SettingsCard>
<controls:SettingsCard <controls:SettingsCard x:Uid="PowerLauncher_UsePinyin" HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xE98A;}">
x:Uid="PowerLauncher_UsePinyin" <ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.UsePinyin, Mode=TwoWay}" />
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xE98A;}">
<ToggleSwitch
x:Uid="ToggleSwitch"
IsOn="{x:Bind ViewModel.UsePinyin, Mode=TwoWay}" />
</controls:SettingsCard> </controls:SettingsCard>
<controls:SettingsCard x:Uid="PowerLauncher_GenerateThumbnailsFromFiles"> <controls:SettingsCard x:Uid="PowerLauncher_GenerateThumbnailsFromFiles">
@ -388,8 +384,10 @@
Visibility="{x:Bind Path=ShowComboBox, Converter={StaticResource BoolToVisibilityConverter}}"> Visibility="{x:Bind Path=ShowComboBox, Converter={StaticResource BoolToVisibilityConverter}}">
<ComboBox <ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}" MinWidth="{StaticResource SettingActionControlMinWidth}"
ItemsSource="{x:Bind Path=ComboBoxOptions}" DisplayMemberPath="Key"
SelectedIndex="{x:Bind Path=ComboBoxValue, Mode=TwoWay}" /> ItemsSource="{x:Bind Path=ComboBoxItems}"
SelectedValue="{x:Bind Path=ComboBoxValue, Mode=TwoWay}"
SelectedValuePath="Value" />
</controls:SettingsCard> </controls:SettingsCard>
<!-- TextBox setting --> <!-- TextBox setting -->
<controls:SettingsCard <controls:SettingsCard
@ -456,8 +454,10 @@
IsEnabled="{x:Bind Path=SecondSettingIsEnabled, Mode=OneWay}"> IsEnabled="{x:Bind Path=SecondSettingIsEnabled, Mode=OneWay}">
<ComboBox <ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}" MinWidth="{StaticResource SettingActionControlMinWidth}"
ItemsSource="{x:Bind Path=ComboBoxOptions}" DisplayMemberPath="Key"
SelectedIndex="{x:Bind Path=ComboBoxValue, Mode=TwoWay}" /> ItemsSource="{x:Bind Path=ComboBoxItems}"
SelectedValue="{x:Bind Path=ComboBoxValue, Mode=TwoWay}"
SelectedValuePath="Value" />
</controls:SettingsCard> </controls:SettingsCard>
</StackPanel> </StackPanel>
<!-- Checkbox And TextBox setting --> <!-- Checkbox And TextBox setting -->

View File

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