PowerToys/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/KeyboardManagerPage.xaml
Jay 44fd8aa8a8
Update KeyboardManagerPage.xaml (#12866)
1 incorrect link (missed a letter) and two icons because of #10331
2021-08-24 19:21:48 +02:00

220 lines
13 KiB
XML

<Page
x:Class="Microsoft.PowerToys.Settings.UI.Views.KeyboardManagerPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:Lib="using:Microsoft.PowerToys.Settings.UI.Library"
mc:Ignorable="d"
AutomationProperties.LandmarkType="Main">
<Page.Resources>
<local:VisibleIfNotEmpty x:Key="visibleIfNotEmptyConverter" />
<Style TargetType="ListViewItem" x:Name="KeysListViewContainerStyle">
<Setter Property="IsTabStop" Value="False"/>
</Style>
<DataTemplate x:Key="OriginalKeyTemplate" x:DataType="x:String">
<Border Background="{ThemeResource ButtonBackground}"
BorderBrush="{ThemeResource ButtonBorderBrush}"
BorderThickness="{ThemeResource ButtonBorderThemeThickness}"
CornerRadius="{ThemeResource ControlCornerRadius}"
Padding="{ThemeResource ButtonPadding}"
VerticalAlignment="Center"
HorizontalAlignment="Left">
<TextBlock FontWeight="SemiBold"
Foreground="{ThemeResource ButtonForeground}"
VerticalAlignment="Center"
TextAlignment="Center"
FontSize="12"
Text="{Binding}" />
</Border>
</DataTemplate>
<DataTemplate x:Key="RemappedKeyTemplate" x:DataType="x:String">
<Border Background="{ThemeResource ButtonBackground}"
BorderBrush="{ThemeResource AccentButtonBackground}"
BorderThickness="{ThemeResource ButtonBorderThemeThickness}"
CornerRadius="{ThemeResource ControlCornerRadius}"
Padding="{ThemeResource ButtonPadding}"
VerticalAlignment="Center"
HorizontalAlignment="Left">
<TextBlock FontWeight="SemiBold"
Foreground="{ThemeResource AccentButtonBackground}"
VerticalAlignment="Center"
TextAlignment="Center"
FontSize="12"
Text="{Binding}" />
</Border>
</DataTemplate>
<!--<DataTemplate x:Name="KeysListViewTemplate" x:DataType="Lib:KeysDataModel">
<StackPanel
Name="KeyboardManager_RemappedKeysListItem"
x:Uid="KeyboardManager_RemappedKeysListItem"
Orientation="Horizontal"
Height="56">
</StackPanel>
</DataTemplate>-->
<!--<DataTemplate x:Name="ShortcutKeysListViewTemplate" x:DataType="Lib:AppSpecificKeysDataModel">
<StackPanel
Name="KeyboardManager_RemappedShortcutsListItem"
x:Uid="KeyboardManager_RemappedShortcutsListItem"
Orientation="Horizontal"
Height="56">
</DataTemplate>-->
</Page.Resources>
<controls:SettingsPageControl x:Uid="KeyboardManager"
ModuleImageSource="ms-appx:///Assets/Modules/KBM.png"
ModuleImageLink="https://aka.ms/PowerToysOverview_KeyboardManager">
<controls:SettingsPageControl.ModuleContent>
<StackPanel Orientation="Vertical">
<controls:Setting x:Uid="KeyboardManager_EnableToggle">
<controls:Setting.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsKeyboardManager.png" ShowAsMonochrome="False" />
</controls:Setting.Icon>
<controls:Setting.ActionContent>
<ToggleSwitch IsOn="{x:Bind Path=ViewModel.Enabled, Mode=TwoWay}" />
</controls:Setting.ActionContent>
<controls:Setting.Description>
<HyperlinkButton NavigateUri="https://aka.ms/powerToysCannotRemapKeys">
<TextBlock x:Uid="KBM_KeysCannotBeRemapped" FontWeight="SemiBold" />
</HyperlinkButton>
</controls:Setting.Description>
</controls:Setting>
<controls:SettingsGroup x:Uid="KeyboardManager_Keys" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.Enabled}">
<Button x:Uid="KeyboardManager_RemapKeyboardButton_Accessible" Style="{StaticResource SettingButtonStyle}" Command="{Binding Path=RemapKeyboardCommand}">
<controls:Setting x:Uid="KeyboardManager_RemapKeyboardButton" Style="{StaticResource ExpanderHeaderSettingStyle}" Icon="&#xE92E;">
<controls:Setting.ActionContent>
<FontIcon Glyph="&#xE8A7;" FontFamily="{ThemeResource SymbolThemeFontFamily}" />
</controls:Setting.ActionContent>
</controls:Setting>
</Button>
<ListView x:Name="RemapKeysList"
x:Uid="RemapKeysList"
ItemsSource="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay}"
SelectionMode="None"
IsSwipeEnabled="False"
Visibility="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}">
<ListView.ItemTemplate>
<DataTemplate x:DataType="Lib:KeysDataModel">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Stretch"
Background="{ThemeResource CardBackgroundBrush}"
BorderThickness="{ThemeResource CardBorderThickness}"
BorderBrush="{ThemeResource CardBorderBrush}"
CornerRadius="{ThemeResource ControlCornerRadius}"
MinHeight="68">
<ItemsControl Margin="52,0,0,0"
ItemsSource="{x:Bind GetMappedOriginalKeys()}"
ItemTemplate="{StaticResource OriginalKeyTemplate}"
IsTabStop="False">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
<TextBlock Text="to"
Style="{StaticResource SecondaryTextStyle}"
VerticalAlignment="Center"
Margin="8,0,8,0"/>
<ItemsControl Name="KeyboardManager_RemappedTo"
x:Uid="KeyboardManager_RemappedTo"
ItemsSource="{x:Bind GetMappedNewRemapKeys()}"
ItemTemplate="{StaticResource RemappedKeyTemplate}"
IsTabStop="False">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</controls:SettingsGroup>
<controls:SettingsGroup x:Uid="KeyboardManager_Shortcuts" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.Enabled}">
<Button x:Uid="KeyboardManager_RemapShortcutsButton_Accessible" Style="{StaticResource SettingButtonStyle}" Command="{Binding Path=EditShortcutCommand}">
<controls:Setting x:Uid="KeyboardManager_RemapShortcutsButton" Style="{StaticResource ExpanderHeaderSettingStyle}" Icon="&#xE92E;">
<controls:Setting.ActionContent>
<FontIcon Glyph="&#xE8A7;" FontFamily="{ThemeResource SymbolThemeFontFamily}" />
</controls:Setting.ActionContent>
</controls:Setting>
</Button>
<ListView x:Name="RemapShortcutsList"
x:Uid="RemapShortcutsList"
ItemsSource="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay}"
SelectionMode="None"
IsSwipeEnabled="False"
Visibility="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}">
<ListView.ItemTemplate>
<DataTemplate x:DataType="Lib:AppSpecificKeysDataModel">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Stretch"
Background="{ThemeResource CardBackgroundBrush}"
BorderThickness="{ThemeResource CardBorderThickness}"
BorderBrush="{ThemeResource CardBorderBrush}"
CornerRadius="{ThemeResource ControlCornerRadius}"
MinHeight="68">
<ItemsControl Margin="52,0,0,0"
ItemsSource="{x:Bind GetMappedOriginalKeys()}"
ItemTemplate="{StaticResource OriginalKeyTemplate}"
IsTabStop="False">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" Spacing="4"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
<TextBlock x:Uid="To"
Style="{StaticResource SecondaryTextStyle}"
VerticalAlignment="Center"
Margin="8,0,8,0"/>
<ItemsControl Name="KeyboardManager_RemappedTo"
x:Uid="KeyboardManager_RemappedTo"
ItemsSource="{x:Bind GetMappedNewRemapKeys()}"
ItemTemplate="{StaticResource RemappedKeyTemplate}"
IsTabStop="False">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" Spacing="4"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
<TextBlock Margin="8,0,0,0" Style="{StaticResource SecondaryTextStyle}" VerticalAlignment="Center">
<Run Text="{x:Bind TargetApp}" FontWeight="SemiBold"/>
</TextBlock>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</controls:SettingsGroup>
</StackPanel>
</controls:SettingsPageControl.ModuleContent>
<controls:SettingsPageControl.PrimaryLinks>
<controls:PageLink x:Uid="LearnMore_KBM" Link="https://aka.ms/PowerToysOverview_KeyboardManager"/>
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>