mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-19 06:14:11 +08:00
Merge remote-tracking branch 'origin/main' into dev/snickler/net8-upgrade
This commit is contained in:
commit
f058e81ed0
@ -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)
|
||||
{
|
||||
|
@ -1,10 +1,11 @@
|
||||
<Application x:Class="FancyZonesEditor.App"
|
||||
<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">
|
||||
Exit="OnExit"
|
||||
Startup="OnStartup">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
|
@ -1,10 +1,12 @@
|
||||
<UserControl x:Class="FancyZonesEditor.CanvasEditor"
|
||||
<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">
|
||||
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" />
|
||||
|
@ -1,57 +1,63 @@
|
||||
<local:EditorWindow x:Class="FancyZonesEditor.CanvasEditorWindow"
|
||||
AutomationProperties.Name="{x:Static props:Resources.Canvas_Layout_Editor}"
|
||||
<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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:FancyZonesEditor"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
|
||||
mc:Ignorable="d"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
Title=""
|
||||
Height="196"
|
||||
MinWidth="360"
|
||||
BorderThickness="0"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
ui:WindowHelper.UseModernWindowStyle="True"
|
||||
ui:TitleBar.IsIconVisible="False"
|
||||
SizeToContent="Width"
|
||||
ui:WindowHelper.UseModernWindowStyle="True"
|
||||
AutomationProperties.Name="{x:Static props:Resources.Canvas_Layout_Editor}"
|
||||
Background="{DynamicResource PrimaryBackgroundBrush}"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
BorderThickness="0"
|
||||
Closed="OnClosed"
|
||||
ContentRendered="EditorWindow_ContentRendered"
|
||||
Closed="OnClosed">
|
||||
ResizeMode="NoResize"
|
||||
SizeToContent="Width"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
mc:Ignorable="d">
|
||||
<Grid Height="160">
|
||||
<Grid Height="36"
|
||||
Background="{DynamicResource SecondaryBackgroundBrush}"
|
||||
<Grid
|
||||
Height="36"
|
||||
Margin="0,-36,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Stretch">
|
||||
<Border Background="{DynamicResource TitleBarSecondaryForegroundBrush}"
|
||||
Background="{DynamicResource SecondaryBackgroundBrush}">
|
||||
<Border
|
||||
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" VerticalAlignment="Bottom"
|
||||
<StackPanel
|
||||
Margin="16"
|
||||
VerticalAlignment="Bottom"
|
||||
FocusManager.FocusedElement="{Binding ElementName=newZoneButton}">
|
||||
|
||||
<local:ClickAutomationEventButton x:Name="newZoneButton"
|
||||
HorizontalAlignment="Stretch"
|
||||
Height="64"
|
||||
<local:ClickAutomationEventButton
|
||||
x:Name="newZoneButton"
|
||||
Width="64"
|
||||
ui:ControlHelper.CornerRadius="64"
|
||||
Height="64"
|
||||
Margin="0,8,0,0"
|
||||
Style="{StaticResource AccentButtonStyle}"
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
Content=""
|
||||
FontSize="24"
|
||||
TabIndex="0"
|
||||
ToolTip="{x:Static props:Resources.Add_zone}"
|
||||
DataContext="{Binding Path=Model, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
|
||||
IsEnabled="{Binding IsZoneAddingAllowed}"
|
||||
HorizontalAlignment="Stretch"
|
||||
ui:ControlHelper.CornerRadius="64"
|
||||
Click="OnAddZone"
|
||||
OnClickAutomationValue="{x:Static props:Resources.New_zone_added}" />
|
||||
Content=""
|
||||
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"
|
||||
<Button
|
||||
Grid.Column="2"
|
||||
TabIndex="2"
|
||||
Click="OnCancel" />
|
||||
<Button Content="{x:Static props:Resources.Save_Apply}"
|
||||
Style="{StaticResource AccentButtonStyle}"
|
||||
TabIndex="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Click="OnSaveApplyTemplate" />
|
||||
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>
|
||||
|
@ -1,14 +1,16 @@
|
||||
<UserControl x:Class="FancyZonesEditor.CanvasZone"
|
||||
<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"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="Transparent"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
KeyDown="Border_KeyDown"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<Style x:Key="CanvasZoneThumbStyle" TargetType="{x:Type Thumb}">
|
||||
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
|
||||
@ -16,12 +18,13 @@
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Thumb}">
|
||||
<Border x:Name="ThumbBorder"
|
||||
Opacity="0"
|
||||
CornerRadius="0"
|
||||
<Border
|
||||
x:Name="ThumbBorder"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Background="{TemplateBinding Background}">
|
||||
CornerRadius="0"
|
||||
Opacity="0">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualStateGroup.Transitions>
|
||||
@ -34,7 +37,11 @@
|
||||
<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"
|
||||
<Border
|
||||
x:Name="border"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Background="{TemplateBinding Background}"
|
||||
SnapsToDevicePixels="true">
|
||||
<ContentPresenter x:Name="contentPresenter"
|
||||
Focusable="False"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
<ContentPresenter
|
||||
x:Name="contentPresenter"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Focusable="False"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
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,25 +93,20 @@
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Border CornerRadius="0"
|
||||
Focusable="True"
|
||||
<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>
|
||||
@ -138,60 +127,148 @@
|
||||
<ColumnDefinition Width="8" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<DockPanel HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
<DockPanel
|
||||
Grid.Row="2"
|
||||
Grid.Column="2"
|
||||
Grid.Row="2">
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<Label
|
||||
Name="LabelID"
|
||||
DockPanel.Dock="Top"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="ID"
|
||||
FontWeight="SemiBold"
|
||||
DockPanel.Dock="Top"
|
||||
FontSize="64"
|
||||
Foreground="{Binding ElementName=RootBorder, Path=BorderBrush}" />
|
||||
<TextBlock FontSize="16"
|
||||
Foreground="{Binding ElementName=RootBorder, Path=BorderBrush}"
|
||||
Opacity="0.6"
|
||||
DockPanel.Dock="Bottom"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="{Binding ElementName=RootBorder, Path=BorderBrush}" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
VerticalAlignment="Center"
|
||||
DockPanel.Dock="Bottom"
|
||||
FontSize="16"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="{Binding ElementName=RootBorder, Path=BorderBrush}"
|
||||
Opacity="0.6">
|
||||
<Run x:Name="WidthLabel" />
|
||||
<Run Text=""
|
||||
<Run
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
FontSize="10"
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}" />
|
||||
Text="" />
|
||||
<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="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="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}"/>
|
||||
|
||||
<Button Content=""
|
||||
BorderThickness="0"
|
||||
ToolTip="{x:Static props:Resources.Delete_Zone}"
|
||||
Background="Transparent"
|
||||
FontSize="16"
|
||||
<Thumb
|
||||
x:Name="Caption"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="5"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="5"
|
||||
Margin="-1"
|
||||
Padding="4"
|
||||
Click="OnClose"
|
||||
IsTabStop="False"
|
||||
Focusable="False"
|
||||
Background="Transparent"
|
||||
BorderThickness="3"
|
||||
Cursor="SizeAll"
|
||||
DragDelta="UniversalDragDelta"
|
||||
DragStarted="Caption_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"
|
||||
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
|
||||
Grid.Row="2"
|
||||
Grid.Column="2"
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
Padding="4"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top" Style="{DynamicResource CloseButtonStyle}"/>
|
||||
VerticalAlignment="Top"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Click="OnClose"
|
||||
Content=""
|
||||
Focusable="False"
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
FontSize="16"
|
||||
IsTabStop="False"
|
||||
Style="{DynamicResource CloseButtonStyle}"
|
||||
ToolTip="{x:Static props:Resources.Delete_Zone}" />
|
||||
|
||||
<Canvas x:Name="Body" />
|
||||
</Grid>
|
||||
|
@ -1,9 +1,10 @@
|
||||
<Button x:Class="FancyZonesEditor.ClickAutomationEventButton"
|
||||
<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>
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d" />
|
||||
|
@ -1,5 +1,5 @@
|
||||
<Slider x:Class="FancyZonesEditor.Controls.CustomSlider"
|
||||
<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>
|
||||
xmlns:local="clr-namespace:FancyZonesEditor.Controls" />
|
||||
|
@ -13,29 +13,32 @@
|
||||
<Grid>
|
||||
<Canvas x:Name="Preview" />
|
||||
<Canvas x:Name="AdornerLayer" />
|
||||
<Canvas x:Name="MergePanel"
|
||||
<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}">
|
||||
<StackPanel x:Name="MergeButtons" Orientation="Horizontal">
|
||||
<Border Background="{DynamicResource PrimaryBackgroundBrush}" CornerRadius="4">
|
||||
|
||||
<Button Width="134"
|
||||
<Button
|
||||
Width="134"
|
||||
Height="36"
|
||||
Margin="0"
|
||||
Style="{StaticResource DefaultButtonStyle}"
|
||||
Click="MergeClick">
|
||||
Click="MergeClick"
|
||||
Style="{StaticResource DefaultButtonStyle}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text=""
|
||||
<TextBlock
|
||||
Margin="0,3,8,0"
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
Foreground="{DynamicResource PrimaryForegroundBrush}"
|
||||
Margin="0,3,8,0" />
|
||||
<TextBlock Text="{x:Static props:Resources.Merge_zones}"
|
||||
Foreground="{DynamicResource PrimaryForegroundBrush}"/>
|
||||
Text="" />
|
||||
<TextBlock Foreground="{DynamicResource PrimaryForegroundBrush}" Text="{x:Static props:Resources.Merge_zones}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</Border>
|
||||
|
@ -1,66 +1,59 @@
|
||||
<local:EditorWindow x:Class="FancyZonesEditor.GridEditorWindow"
|
||||
AutomationProperties.Name="{x:Static props:Resources.Grid_Layout_Editor}"
|
||||
<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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:FancyZonesEditor"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
|
||||
mc:Ignorable="d"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
Title=""
|
||||
MinWidth="360"
|
||||
BorderThickness="0"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
ui:WindowHelper.UseModernWindowStyle="True"
|
||||
ui:TitleBar.IsIconVisible="False"
|
||||
SizeToContent="WidthAndHeight"
|
||||
ui:WindowHelper.UseModernWindowStyle="True"
|
||||
AutomationProperties.Name="{x:Static props:Resources.Grid_Layout_Editor}"
|
||||
Background="{DynamicResource PrimaryBackgroundBrush}"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
BorderThickness="0"
|
||||
Closed="OnClosed"
|
||||
ContentRendered="EditorWindow_ContentRendered"
|
||||
Closed="OnClosed">
|
||||
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
|
||||
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
|
||||
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>
|
||||
@ -70,17 +63,19 @@
|
||||
<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>
|
||||
|
@ -1,46 +1,49 @@
|
||||
<Thumb x:Class="FancyZonesEditor.GridResizer"
|
||||
<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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:props="clr-namespace:FancyZonesEditor.Properties"
|
||||
mc:Ignorable="d"
|
||||
Focusable="True"
|
||||
d:DesignHeight="300"
|
||||
d:DesignWidth="300"
|
||||
AutomationProperties.Name="{x:Static props:Resources.Resizer_Thumb_Announce}"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
Focusable="True"
|
||||
mc:Ignorable="d">
|
||||
<Thumb.Template>
|
||||
<ControlTemplate>
|
||||
<Border x:Name="Body"
|
||||
Height="48"
|
||||
<Border
|
||||
x:Name="Body"
|
||||
Width="48"
|
||||
CornerRadius="48"
|
||||
Background="{DynamicResource SystemControlBackgroundAccentBrush}">
|
||||
Height="48"
|
||||
Background="{DynamicResource SystemControlBackgroundAccentBrush}"
|
||||
CornerRadius="48">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="6"
|
||||
<DropShadowEffect
|
||||
BlurRadius="6"
|
||||
Opacity="0.24"
|
||||
ShadowDepth="1" />
|
||||
</Border.Effect>
|
||||
<Grid>
|
||||
<Rectangle Height="20"
|
||||
<Rectangle
|
||||
Width="2"
|
||||
Fill="White"
|
||||
Margin="5,0,0,0" />
|
||||
<Rectangle Height="20"
|
||||
Height="20"
|
||||
Margin="5,0,0,0"
|
||||
Fill="White" />
|
||||
<Rectangle
|
||||
Width="2"
|
||||
Fill="White"
|
||||
Margin="-5,0,0,0" />
|
||||
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>
|
||||
|
@ -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"
|
||||
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"
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
VerticalAlignment="Center"
|
||||
DockPanel.Dock="Bottom"
|
||||
FontSize="16"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource SecondaryForegroundBrush}">
|
||||
<Run x:Name="WidthLabel" />
|
||||
<Run Text="×" />
|
||||
<Run x:Name="HeightLabel" />
|
||||
|
@ -1,16 +1,17 @@
|
||||
<Window x:Class="FancyZonesEditor.LayoutOverlayWindow"
|
||||
<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"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="FancyZones Layout"
|
||||
Height="450"
|
||||
Width="800"
|
||||
ShowInTaskbar="False"
|
||||
ResizeMode="NoResize"
|
||||
WindowStyle="None"
|
||||
Height="450"
|
||||
AllowsTransparency="True"
|
||||
Background="{DynamicResource BackdropBrush}"
|
||||
Loaded="Window_Loaded"
|
||||
Background="{DynamicResource BackdropBrush}"/>
|
||||
ResizeMode="NoResize"
|
||||
ShowInTaskbar="False"
|
||||
WindowStyle="None"
|
||||
mc:Ignorable="d" />
|
@ -1,17 +1,16 @@
|
||||
<UserControl x:Class="FancyZonesEditor.LayoutPreview"
|
||||
<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"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800">
|
||||
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
@ -1,4 +1,5 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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">
|
||||
|
||||
@ -27,13 +28,37 @@
|
||||
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"
|
||||
<DoubleAnimation
|
||||
Storyboard.TargetName="CheckGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
@ -43,34 +68,10 @@
|
||||
<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,26 +91,28 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="IconOnlyButtonStyle"
|
||||
<Style
|
||||
x:Key="IconOnlyButtonStyle"
|
||||
BasedOn="{StaticResource DefaultButtonStyle}"
|
||||
TargetType="Button">
|
||||
<Setter Property="Background"
|
||||
Value="Transparent" />
|
||||
<Setter Property="Foreground"
|
||||
Value="{DynamicResource ButtonForeground}" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="Background"
|
||||
<Border
|
||||
x:Name="Background"
|
||||
Background="Transparent"
|
||||
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
|
||||
SnapsToDevicePixels="True">
|
||||
<Border x:Name="Border"
|
||||
<Border
|
||||
x:Name="Border"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Focusable="False"
|
||||
@ -118,35 +121,18 @@
|
||||
</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>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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">
|
||||
|
||||
@ -6,130 +7,101 @@
|
||||
<Setter Property="Control.Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Border Margin="-2"
|
||||
CornerRadius="4"
|
||||
<Border
|
||||
Margin="-2"
|
||||
BorderBrush="{DynamicResource PrimaryForegroundBrush}"
|
||||
BorderThickness="2"
|
||||
BorderBrush="{DynamicResource PrimaryForegroundBrush}" />
|
||||
CornerRadius="4" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<DropShadowEffect x:Key="CardDropShadow"
|
||||
<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" />
|
||||
<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}"
|
||||
<Border
|
||||
x:Name="ContentBorder"
|
||||
Width="{Binding DisplayWidth}"
|
||||
Height="{Binding DisplayHeight}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
Effect="{StaticResource CardDropShadow}">
|
||||
Effect="{StaticResource CardDropShadow}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
|
||||
<VisualStateManager.CustomVisualStateManager>
|
||||
<ui:SimpleVisualStateManager />
|
||||
</VisualStateManager.CustomVisualStateManager>
|
||||
|
||||
<Grid>
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
<Border x:Name="BorderRectangle"
|
||||
IsHitTestVisible="False"
|
||||
<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" />
|
||||
<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 -->
|
||||
<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 -->
|
||||
<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"
|
||||
@ -150,140 +122,100 @@
|
||||
<!-- 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}" />
|
||||
<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"
|
||||
<Border
|
||||
x:Name="ContentBorder"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
Effect="{StaticResource CardDropShadow}">
|
||||
Effect="{StaticResource CardDropShadow}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
|
||||
<VisualStateManager.CustomVisualStateManager>
|
||||
<ui:SimpleVisualStateManager />
|
||||
</VisualStateManager.CustomVisualStateManager>
|
||||
|
||||
<Grid>
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
<Border x:Name="BorderRectangle"
|
||||
IsHitTestVisible="False"
|
||||
<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" />
|
||||
<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 -->
|
||||
<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 -->
|
||||
<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"
|
||||
@ -304,30 +236,19 @@
|
||||
<!-- 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}" />
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="ContentBorder" Property="Opacity" Value="{DynamicResource ListViewItemDisabledThemeOpacity}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
@ -1,9 +1,14 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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">
|
||||
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}" />
|
||||
|
@ -1,4 +1,5 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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">
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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">
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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">
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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">
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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">
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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">
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
@ -41,6 +41,9 @@ namespace Microsoft.Plugin.Shell
|
||||
Cmd = 0,
|
||||
Powershell = 1,
|
||||
RunCommand = 2,
|
||||
WindowsTerminal = 3,
|
||||
WindowsTerminalPowerShell = 3,
|
||||
WindowsTerminalPowerShellSeven = 4,
|
||||
WindowsTerminalCmd = 5,
|
||||
PowerShellSeven = 6,
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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=}">
|
||||
<ToggleSwitch
|
||||
x:Uid="ToggleSwitch"
|
||||
IsOn="{x:Bind ViewModel.UsePinyin, Mode=TwoWay}" />
|
||||
<controls:SettingsCard x:Uid="PowerLauncher_UsePinyin" HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=}">
|
||||
<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 -->
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user