Skip to content

Commit

Permalink
Keyboard text alignment (#7197)
Browse files Browse the repository at this point in the history
* Add HorizontalTextAlignment="Right" to KeyboardAcceleratorTextLabel so the text align to the right

* Add HorizontalTextAlignment="Right" to KeyboardAcceleratorTextBlock so the text align to right

* Remove horizontal alignment on Textblock not having contract6Present

* Add contract5Present in front of all the HorizontalTextAlignment="Right"

Co-authored-by: Yawen Hou <[email protected]>
  • Loading branch information
Sytta and Sytta authored Aug 25, 2022
1 parent 9365586 commit 65a7d54
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dev/CommandBarFlyout/CommandBarFlyout_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.UI.Xaml.Controls.Primitives"
xmlns:contract4Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,4)"
xmlns:contract5Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,5)"
xmlns:contract6Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,6)"
xmlns:contract6NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,6)"
xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"
Expand Down Expand Up @@ -334,6 +335,7 @@
Foreground="{ThemeResource CommandBarFlyoutAppBarButtonKeyboardTextLabelForeground}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
contract5Present:HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />
<FontIcon x:Name="SubItemChevron"
Expand Down Expand Up @@ -588,6 +590,7 @@
Foreground="{ThemeResource CommandBarFlyoutAppBarButtonKeyboardTextLabelForeground}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
contract5Present:HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@
Foreground="{ThemeResource SystemControlBackgroundBaseMediumBrush}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />
</Grid>
Expand Down
1 change: 1 addition & 0 deletions dev/CommonStyles/AppBarButton_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@
Foreground="{ThemeResource AppBarButtonKeyboardAcceleratorTextForeground}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />
<Grid x:Name="SubItemChevronPanel"
Expand Down
3 changes: 2 additions & 1 deletion dev/CommonStyles/AppBarButton_themeresources_v1.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@
Foreground="{ThemeResource AppBarButtonKeyboardAcceleratorTextForeground}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />
<FontIcon x:Name="SubItemChevron"
Expand All @@ -434,4 +435,4 @@
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</ResourceDictionary>
1 change: 1 addition & 0 deletions dev/CommonStyles/AppBarToggleButton_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@
Foreground="{ThemeResource AppBarToggleButtonKeyboardAcceleratorTextForeground}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />

Expand Down
1 change: 1 addition & 0 deletions dev/CommonStyles/AppBarToggleButton_themeresources_v1.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@
Foreground="{ThemeResource AppBarToggleButtonKeyboardAcceleratorTextForeground}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:contract5Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,5)"
xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"
xmlns:contract7NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,7)"
xmlns:contract8Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,8)">
Expand Down Expand Up @@ -583,6 +584,7 @@
Foreground="{ThemeResource AppBarButtonKeyboardAcceleratorTextForeground}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
contract5Present:HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />
<Border
Expand Down
5 changes: 5 additions & 0 deletions dev/CommonStyles/MenuFlyout_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:media="using:Microsoft.UI.Xaml.Media"
xmlns:contract5Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,5)"
xmlns:contract6Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,6)"
xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"
xmlns:contract7NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,7)">
Expand Down Expand Up @@ -467,6 +468,7 @@
Foreground="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"
HorizontalAlignment="Right"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
contract5Present:HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />
</Grid>
Expand Down Expand Up @@ -609,6 +611,7 @@
Foreground="{ThemeResource ToggleMenuFlyoutItemKeyboardAcceleratorTextForeground}"
HorizontalAlignment="Right"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
contract5Present:HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />
</Grid>
Expand Down Expand Up @@ -892,6 +895,7 @@
Foreground="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"
HorizontalAlignment="Right"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
contract5Present:HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />

Expand Down Expand Up @@ -1035,6 +1039,7 @@
Foreground="{ThemeResource ToggleMenuFlyoutItemKeyboardAcceleratorTextForeground}"
HorizontalAlignment="Right"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
contract5Present:HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />
</Grid>
Expand Down
4 changes: 4 additions & 0 deletions dev/CommonStyles/MenuFlyout_themeresources_v1.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:media="using:Microsoft.UI.Xaml.Media"
xmlns:contract5Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,5)"
xmlns:contract6Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,6)"
xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"
xmlns:contract7NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,7)">
Expand Down Expand Up @@ -446,6 +447,7 @@
Foreground="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"
HorizontalAlignment="Right"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
contract5Present:HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />

Expand Down Expand Up @@ -589,6 +591,7 @@
Foreground="{ThemeResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"
HorizontalAlignment="Right"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
contract5Present:HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />
</Grid>
Expand Down Expand Up @@ -749,6 +752,7 @@
Foreground="{ThemeResource ToggleMenuFlyoutItemKeyboardAcceleratorTextForeground}"
HorizontalAlignment="Right"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
contract5Present:HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:contract5Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,5)"
xmlns:local="using:Microsoft.UI.Xaml.Controls">

<Style TargetType="local:RadioMenuFlyoutItem" BasedOn="{StaticResource DefaultRadioMenuFlyoutItemStyle}" />
Expand Down Expand Up @@ -171,6 +172,7 @@
Foreground="{ThemeResource ToggleMenuFlyoutItemKeyboardAcceleratorTextForeground}"
HorizontalAlignment="Right"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
contract5Present:HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:contract5Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,5)"
xmlns:local="using:Microsoft.UI.Xaml.Controls">

<Style TargetType="local:RadioMenuFlyoutItem" BasedOn="{StaticResource DefaultRadioMenuFlyoutItemStyle}" />
Expand Down Expand Up @@ -159,6 +160,7 @@
Foreground="{ThemeResource ToggleMenuFlyoutItemKeyboardAcceleratorTextForeground}"
HorizontalAlignment="Right"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
contract5Present:HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:contract5Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,5)"
xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"
xmlns:contract6Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,6)"
xmlns:local="using:Microsoft.UI.Xaml.Controls">
Expand Down Expand Up @@ -148,6 +149,7 @@
Foreground="{ThemeResource ToggleMenuFlyoutItemKeyboardAcceleratorTextForeground}"
HorizontalAlignment="Right"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
contract5Present:HorizontalTextAlignment="Right"
Visibility="Collapsed"
AutomationProperties.AccessibilityView="Raw" />
</Grid>
Expand Down

0 comments on commit 65a7d54

Please sign in to comment.