Revert buttons on KBM Landing page (#2870)

* Revert buttons

* Fixed button placement
This commit is contained in:
Arjun Balgovind 2020-05-12 09:21:54 -07:00 committed by GitHub
parent 69cde6092b
commit 66c2d1cba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 233 additions and 224 deletions

View File

@ -177,7 +177,7 @@
<value>Select the profile to display the active key remap and shortcuts</value> <value>Select the profile to display the active key remap and shortcuts</value>
<comment>Keyboard Manager configuration dropdown decription</comment> <comment>Keyboard Manager configuration dropdown decription</comment>
</data> </data>
<data name="KeyboardManager_RemapKeyboardButton.Label" xml:space="preserve"> <data name="KeyboardManager_RemapKeyboardButton.Content" xml:space="preserve">
<value>Remap a key</value> <value>Remap a key</value>
<comment>Keyboard Manager remap keyboard button content</comment> <comment>Keyboard Manager remap keyboard button content</comment>
</data> </data>
@ -185,7 +185,7 @@
<value>Remap keyboard</value> <value>Remap keyboard</value>
<comment>Keyboard Manager remap keyboard header</comment> <comment>Keyboard Manager remap keyboard header</comment>
</data> </data>
<data name="KeyboardManager_RemapShortcutsButton.Label" xml:space="preserve"> <data name="KeyboardManager_RemapShortcutsButton.Content" xml:space="preserve">
<value>Remap a shortcut</value> <value>Remap a shortcut</value>
<comment>Keyboard Manager remap shortcuts button</comment> <comment>Keyboard Manager remap shortcuts button</comment>
</data> </data>

View File

@ -1,229 +1,238 @@
<Page <Page
x:Class="Microsoft.PowerToys.Settings.UI.Views.KeyboardManagerPage" x:Class="Microsoft.PowerToys.Settings.UI.Views.KeyboardManagerPage"
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:local="using:Microsoft.PowerToys.Settings.UI.Views" xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModel="using:Microsoft.PowerToys.Settings.UI.ViewModels" xmlns:viewModel="using:Microsoft.PowerToys.Settings.UI.ViewModels"
xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions" xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
xmlns:Lib="using:Microsoft.PowerToys.Settings.UI.Lib" xmlns:Lib="using:Microsoft.PowerToys.Settings.UI.Lib"
mc:Ignorable="d" mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Page.Resources> <Page.Resources>
<viewModel:KeyboardManagerViewModel x:Key="eventViewModel"/> <viewModel:KeyboardManagerViewModel x:Key="eventViewModel"/>
<local:VisibleIfNotEmpty x:Key="visibleIfNotEmptyConverter" /> <local:VisibleIfNotEmpty x:Key="visibleIfNotEmptyConverter" />
<DataTemplate x:Name="KeysListViewTemplate" x:DataType="Lib:KeysDataModel"> <DataTemplate x:Name="KeysListViewTemplate" x:DataType="Lib:KeysDataModel">
<StackPanel <StackPanel
Orientation="Horizontal" Orientation="Horizontal"
Height="56"> Height="56">
<ItemsControl <ItemsControl
ItemsSource="{x:Bind GetOriginalKeys()}"> ItemsSource="{x:Bind GetOriginalKeys()}">
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/> <StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<Border <Border
Background="{ThemeResource SystemBaseLowColor}" Background="{ThemeResource SystemBaseLowColor}"
CornerRadius="4" CornerRadius="4"
Padding="14,0,14,0" Padding="14,0,14,0"
Margin="5,0,5,0" Margin="5,0,5,0"
Height="36" Height="36"
VerticalAlignment="Center" VerticalAlignment="Center"
HorizontalAlignment="Left"> HorizontalAlignment="Left">
<TextBlock <TextBlock
FontWeight="SemiBold" FontWeight="SemiBold"
VerticalAlignment="Center" VerticalAlignment="Center"
TextAlignment="Center" TextAlignment="Center"
FontSize="12" FontSize="12"
Text="{Binding}" /> Text="{Binding}" />
</Border> </Border>
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
<FontIcon Glyph="&#xE72A;" <FontIcon Glyph="&#xE72A;"
Grid.Column="1" Grid.Column="1"
FontSize="14" FontSize="14"
VerticalAlignment="Center" VerticalAlignment="Center"
Margin="5,0,5,0"/> Margin="5,0,5,0"/>
<ItemsControl <ItemsControl
ItemsSource="{x:Bind GetNewRemapKeys()}" ItemsSource="{x:Bind GetNewRemapKeys()}"
Grid.Column="2"> Grid.Column="2">
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/> <StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<Border <Border
Background="{ThemeResource SystemAccentColor}" Background="{ThemeResource SystemAccentColor}"
CornerRadius="4" CornerRadius="4"
Padding="14,0,14,0" Padding="14,0,14,0"
Margin="5,0,5,0" Margin="5,0,5,0"
Height="36" Height="36"
VerticalAlignment="Center" VerticalAlignment="Center"
HorizontalAlignment="Left"> HorizontalAlignment="Left">
<TextBlock <TextBlock
FontWeight="SemiBold" FontWeight="SemiBold"
VerticalAlignment="Center" VerticalAlignment="Center"
TextAlignment="Center" TextAlignment="Center"
Foreground="White" Foreground="White"
FontSize="12" FontSize="12"
Text="{Binding}" /> Text="{Binding}" />
</Border> </Border>
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</Page.Resources> </Page.Resources>
<Grid ColumnSpacing="{StaticResource DefaultColumnSpacing}" RowSpacing="{StaticResource DefaultRowSpacing}"> <Grid ColumnSpacing="{StaticResource DefaultColumnSpacing}" RowSpacing="{StaticResource DefaultRowSpacing}">
<VisualStateManager.VisualStateGroups> <VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="LayoutVisualStates"> <VisualStateGroup x:Name="LayoutVisualStates">
<VisualState x:Name="WideLayout"> <VisualState x:Name="WideLayout">
<VisualState.StateTriggers> <VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="{StaticResource WideLayoutMinWidth}" /> <AdaptiveTrigger MinWindowWidth="{StaticResource WideLayoutMinWidth}" />
</VisualState.StateTriggers> </VisualState.StateTriggers>
<VisualState.Setters> <VisualState.Setters>
<Setter Target="SidePanel.(Grid.Column)" Value="1" /> <Setter Target="SidePanel.(Grid.Column)" Value="1" />
<Setter Target="SidePanel.(Grid.Row)" Value="0" /> <Setter Target="SidePanel.(Grid.Row)" Value="0" />
</VisualState.Setters> </VisualState.Setters>
</VisualState> </VisualState>
<VisualState x:Name="SmallLayout"> <VisualState x:Name="SmallLayout">
<VisualState.StateTriggers> <VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="{StaticResource SmallLayoutMinWidth}" /> <AdaptiveTrigger MinWindowWidth="{StaticResource SmallLayoutMinWidth}" />
</VisualState.StateTriggers> </VisualState.StateTriggers>
<VisualState.Setters> <VisualState.Setters>
<Setter Target="SidePanel.(Grid.Column)" Value="0" /> <Setter Target="SidePanel.(Grid.Column)" Value="0" />
<Setter Target="SidePanel.(Grid.Row)" Value="1" /> <Setter Target="SidePanel.(Grid.Row)" Value="1" />
</VisualState.Setters> </VisualState.Setters>
</VisualState> </VisualState>
</VisualStateGroup> </VisualStateGroup>
</VisualStateManager.VisualStateGroups> </VisualStateManager.VisualStateGroups>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<StackPanel Orientation="Vertical"> <StackPanel Orientation="Vertical">
<TextBlock x:Uid="KeyboardManager_Description" <TextBlock x:Uid="KeyboardManager_Description"
TextWrapping="Wrap"/> TextWrapping="Wrap"/>
<ToggleSwitch x:Uid="KeyboardManager_EnableToggle" <ToggleSwitch x:Uid="KeyboardManager_EnableToggle"
IsOn="{x:Bind Path=ViewModel.Enabled, Mode=TwoWay}" IsOn="{x:Bind Path=ViewModel.Enabled, Mode=TwoWay}"
Margin="{StaticResource MediumTopMargin}" /> Margin="{StaticResource MediumTopMargin}" />
<!--<TextBlock x:Uid="KeyboardManager_ConfigHeader" <!--<TextBlock x:Uid="KeyboardManager_ConfigHeader"
Style="{StaticResource SettingsGroupTitleStyle}"/> Style="{StaticResource SettingsGroupTitleStyle}"/>
<TextBlock x:Uid="KeyboardManager_ProfileDescription" <TextBlock x:Uid="KeyboardManager_ProfileDescription"
Margin="{StaticResource SmallTopMargin}"/> Margin="{StaticResource SmallTopMargin}"/>
<ComboBox SelectedIndex="1" MinWidth="160" <ComboBox SelectedIndex="1" MinWidth="160"
Margin="{StaticResource SmallTopMargin}"> Margin="{StaticResource SmallTopMargin}">
<ComboBoxItem Content="Config-1"/> <ComboBoxItem Content="Config-1"/>
<ComboBoxItem Content="Config-2"/> <ComboBoxItem Content="Config-2"/>
<ComboBoxItem Content="Config-3"/> <ComboBoxItem Content="Config-3"/>
</ComboBox>--> </ComboBox>-->
<TextBlock x:Uid="KeyboardManager_RemapKeyboardHeader" <TextBlock x:Uid="KeyboardManager_RemapKeyboardHeader"
Style="{StaticResource SettingsGroupTitleStyle}"/> Style="{StaticResource SettingsGroupTitleStyle}"/>
<TextBlock Text="Click below to remap a single key to another key" <TextBlock Text="Click below to remap a single key to another key"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
TextWrapping="Wrap"/> TextWrapping="Wrap"/>
<Button x:Uid="KeyboardManager_RemapKeyboardButton"
Margin="{StaticResource SmallTopMargin}"
<ListView x:Name="RemapKeysList" Style="{StaticResource AccentButtonStyle}"
extensions:ListViewExtensions.AlternateColor="{ThemeResource SystemControlBackgroundListLowBrush}" Command="{Binding Path=RemapKeyboardCommand}"
ItemsSource="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay}" IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"/>
ItemTemplate="{StaticResource KeysListViewTemplate}"
BorderBrush="{ThemeResource SystemControlForegroundBaseMediumLowBrush}" <ListView x:Name="RemapKeysList"
BorderThickness="1" extensions:ListViewExtensions.AlternateColor="{ThemeResource SystemControlBackgroundListLowBrush}"
CornerRadius="4" ItemsSource="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay}"
MinWidth="350" ItemTemplate="{StaticResource KeysListViewTemplate}"
MaxHeight="200" BorderBrush="{ThemeResource SystemControlForegroundBaseMediumLowBrush}"
Margin="{StaticResource SmallTopBottomMargin}" BorderThickness="1"
HorizontalAlignment="Left" CornerRadius="4"
SelectionMode="None" MinWidth="350"
IsSwipeEnabled="False" MaxHeight="200"
Visibility="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}" Margin="{StaticResource SmallTopBottomMargin}"
/> HorizontalAlignment="Left"
SelectionMode="None"
<AppBarButton x:Uid="KeyboardManager_RemapKeyboardButton" IsSwipeEnabled="False"
Icon="Add" Visibility="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}"
Width="370" />
Style="{StaticResource AddItemAppBarButtonStyle}"
Command="{Binding Path=RemapKeyboardCommand}" <!--<AppBarButton x:Uid="KeyboardManager_RemapKeyboardButton"
Margin="{StaticResource AddItemButtonMargin}" Icon="Add"
HorizontalAlignment="Left" Width="370"
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"/> Style="{StaticResource AddItemAppBarButtonStyle}"
Command="{Binding Path=RemapKeyboardCommand}"
<TextBlock x:Uid="KeyboardManager_RemapShortcutsHeader" Margin="{StaticResource AddItemButtonMargin}"
Style="{StaticResource SettingsGroupTitleStyle}"/> HorizontalAlignment="Left"
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"/>-->
<TextBlock Text="Click below to remap a shortcut (hotkey) to another shortcut"
TextWrapping="Wrap" Margin="{StaticResource SmallTopMargin}"/> <TextBlock x:Uid="KeyboardManager_RemapShortcutsHeader"
Style="{StaticResource SettingsGroupTitleStyle}"/>
<TextBlock Text="Click below to remap a shortcut (hotkey) to another shortcut"
<ListView x:Name="RemapShortcutsList" TextWrapping="Wrap" Margin="{StaticResource SmallTopMargin}"/>
extensions:ListViewExtensions.AlternateColor="{ThemeResource SystemControlBackgroundListLowBrush}"
ItemsSource="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay}" <Button x:Uid="KeyboardManager_RemapShortcutsButton"
ItemTemplate="{StaticResource KeysListViewTemplate}" Margin="{StaticResource SmallTopMargin}"
BorderBrush="{ThemeResource SystemControlForegroundBaseMediumLowBrush}" Style="{StaticResource AccentButtonStyle}"
BorderThickness="1" Command="{Binding Path=EditShortcutCommand}"
CornerRadius="4" IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"
MinWidth="350" />
MaxHeight="200"
Margin="{StaticResource SmallTopBottomMargin}" <ListView x:Name="RemapShortcutsList"
HorizontalAlignment="Left" extensions:ListViewExtensions.AlternateColor="{ThemeResource SystemControlBackgroundListLowBrush}"
SelectionMode="None" ItemsSource="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay}"
IsSwipeEnabled="False" ItemTemplate="{StaticResource KeysListViewTemplate}"
Visibility="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}" BorderBrush="{ThemeResource SystemControlForegroundBaseMediumLowBrush}"
/> BorderThickness="1"
CornerRadius="4"
<AppBarButton x:Uid="KeyboardManager_RemapShortcutsButton" MinWidth="350"
Icon="Add" MaxHeight="200"
Width="370" Margin="{StaticResource SmallTopBottomMargin}"
Style="{StaticResource AddItemAppBarButtonStyle}" HorizontalAlignment="Left"
Command="{Binding Path=EditShortcutCommand}" SelectionMode="None"
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}" IsSwipeEnabled="False"
Margin="{StaticResource AddItemButtonMargin}" Visibility="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}"
HorizontalAlignment="Left" />
/>
</StackPanel> <!--<AppBarButton x:Uid="KeyboardManager_RemapShortcutsButton"
Icon="Add"
<StackPanel Width="370"
x:Name="SidePanel" Style="{StaticResource AddItemAppBarButtonStyle}"
Orientation="Vertical" Command="{Binding Path=EditShortcutCommand}"
HorizontalAlignment="Left" IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"
Width="{StaticResource SidePanelWidth}" Margin="{StaticResource AddItemButtonMargin}"
Grid.Column="1"> HorizontalAlignment="Left"
/>-->
<TextBlock </StackPanel>
x:Uid="About_KeyboardManager"
Style="{StaticResource SettingsGroupTitleStyle}" <StackPanel
Margin="{StaticResource XSmallBottomMargin}"/> x:Name="SidePanel"
Orientation="Vertical"
HorizontalAlignment="Left"
Width="{StaticResource SidePanelWidth}"
Grid.Column="1">
<TextBlock
x:Uid="About_KeyboardManager"
Style="{StaticResource SettingsGroupTitleStyle}"
Margin="{StaticResource XSmallBottomMargin}"/>
<HyperlinkButton> <HyperlinkButton>
<TextBlock x:Uid="Module_overview" /> <TextBlock x:Uid="Module_overview" />
</HyperlinkButton> </HyperlinkButton>
<HyperlinkButton NavigateUri="https://github.com/microsoft/PowerToys/issues"> <HyperlinkButton NavigateUri="https://github.com/microsoft/PowerToys/issues">
<TextBlock x:Uid="Give_Feedback" /> <TextBlock x:Uid="Give_Feedback" />
</HyperlinkButton> </HyperlinkButton>
</StackPanel> </StackPanel>
</Grid> </Grid>
</Page> </Page>