2026-01-28 10:37:22 +08:00
|
|
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
|
|
|
<ResourceDictionary
|
2021-09-06 20:21:18 +02:00
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
2026-02-12 16:45:44 +01:00
|
|
|
xmlns:local="using:Microsoft.PowerToys.Common.UI.Controls"
|
2026-01-28 10:37:22 +08:00
|
|
|
xmlns:tk="using:CommunityToolkit.WinUI"
|
|
|
|
|
xmlns:tkcontrols="using:CommunityToolkit.WinUI.Controls">
|
2021-09-06 20:21:18 +02:00
|
|
|
|
2026-01-28 10:37:22 +08:00
|
|
|
<Style BasedOn="{StaticResource DefaultShortcutWithTextLabelControlStyle}" TargetType="local:ShortcutWithTextLabelControl" />
|
|
|
|
|
|
|
|
|
|
<Style x:Key="DefaultShortcutWithTextLabelControlStyle" TargetType="local:ShortcutWithTextLabelControl">
|
|
|
|
|
<Setter Property="KeyVisualStyle" Value="{StaticResource DefaultKeyVisualStyle}" />
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="local:ShortcutWithTextLabelControl">
|
|
|
|
|
<Grid ColumnSpacing="8">
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<ItemsControl
|
|
|
|
|
x:Name="ShortcutsControl"
|
|
|
|
|
VerticalAlignment="Bottom"
|
|
|
|
|
AutomationProperties.AccessibilityView="Raw"
|
|
|
|
|
IsTabStop="False"
|
|
|
|
|
ItemsSource="{TemplateBinding Keys}">
|
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
|
<StackPanel Orientation="Horizontal" Spacing="4" />
|
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
|
|
<DataTemplate>
|
|
|
|
|
<StackPanel Orientation="Vertical">
|
|
|
|
|
<local:KeyVisual
|
|
|
|
|
tk:FrameworkElementExtensions.AncestorType="local:ShortcutWithTextLabelControl"
|
|
|
|
|
AutomationProperties.AccessibilityView="Raw"
|
|
|
|
|
Content="{Binding}"
|
|
|
|
|
IsTabStop="False"
|
|
|
|
|
Style="{Binding (tk:FrameworkElementExtensions.Ancestor).KeyVisualStyle, RelativeSource={RelativeSource Self}}" />
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</DataTemplate>
|
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
|
</ItemsControl>
|
|
|
|
|
<tkcontrols:MarkdownTextBlock
|
|
|
|
|
x:Name="LabelControl"
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Config="{TemplateBinding MarkdownConfig}"
|
|
|
|
|
Text="{TemplateBinding Text}" />
|
|
|
|
|
<VisualStateManager.VisualStateGroups>
|
|
|
|
|
<VisualStateGroup x:Name="LabelPlacementStates">
|
|
|
|
|
<VisualState x:Name="LabelAfter" />
|
|
|
|
|
<VisualState x:Name="LabelBefore">
|
|
|
|
|
<VisualState.Setters>
|
|
|
|
|
<Setter Target="LabelControl.(Grid.Column)" Value="0" />
|
|
|
|
|
<Setter Target="ShortcutsControl.(Grid.Column)" Value="1" />
|
|
|
|
|
</VisualState.Setters>
|
|
|
|
|
</VisualState>
|
|
|
|
|
</VisualStateGroup>
|
|
|
|
|
</VisualStateManager.VisualStateGroups>
|
|
|
|
|
</Grid>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
</ResourceDictionary>
|