-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style: accessibility improvements to high contrast and text size #377
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for all these changes. We still need a bit of discussion in some areas before we can merge this.
<!-- Use opacity rather than a foreground brush so that it doesn't override the GridViewItem/ListViewItem foreground brushes --> | ||
<x:Double x:Key="TextFillColorSecondaryOpacity">0.775</x:Double> | ||
<x:Double x:Key="TextFillColorTertiaryOpacity">0.53</x:Double> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this. This is so clever! 🤩
<VisualState x:Name="PointerOver"> | ||
<Storyboard> | ||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> | ||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ListViewHeaderItemSubtleButtonBackgroundPointerOver}" /> | ||
</ObjectAnimationUsingKeyFrames> | ||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> | ||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ListViewHeaderItemSubtleButtonBorderBrushPointerOver}" /> | ||
</ObjectAnimationUsingKeyFrames> | ||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> | ||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ListViewHeaderItemSubtleButtonForegroundPointerOver}" /> | ||
</ObjectAnimationUsingKeyFrames> | ||
</Storyboard> | ||
</VisualState> | ||
|
||
<VisualState x:Name="Pressed"> | ||
<Storyboard> | ||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> | ||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ListViewHeaderItemSubtleButtonBackgroundPressed}" /> | ||
</ObjectAnimationUsingKeyFrames> | ||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="BorderBrush"> | ||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ListViewHeaderItemSubtleButtonBorderBrushPressed}" /> | ||
</ObjectAnimationUsingKeyFrames> | ||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> | ||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ListViewHeaderItemSubtleButtonForegroundPressed}" /> | ||
</ObjectAnimationUsingKeyFrames> | ||
</Storyboard> | ||
</VisualState> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we use Storyboard here? Shouldn't VisualState.Setters
be enough here? It doesn't seem like any animation is playing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, is there any penalty that I'm not aware? Aren't 0 time duration animations as performant as they can get? Seems like the default for WinUI/SystemXAML.
</Setter> | ||
</Style> | ||
<!-- ListViewHeaderItem with thicker font and PointerOver/Pressed states --> | ||
<Style x:Key="ListViewHeaderItemSubtleButtonStyle" TargetType="ListViewHeaderItem"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this style different from the GridViewHeaderItemSubtleButtonStyle
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GridViewHeaderItemSubtleButtonStyle
needs a plus 4 side margin to compensate for this (so it's inline with the content):
Line 89 in a93c937
<Thickness x:Key="PageThumbnailMargin">52,0</Thickness> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, you can probably base one style on the other and just override the different values.
<Style x:Key="GridViewHeaderItemSubtleButtonStyle" TargetType="GridViewHeaderItem" BasedOn="{StaticResource ListViewHeaderItemSubtleButtonStyle}">
If that doesn't work you can change the TargetType to ListViewBaseHeaderItem
so both styles target the same type.
add item corner radius resource fix deprecated glyph fix text horizontal alignment set opacity for playing item remove background brush transition fix network page content height fix group overview button text size cut off
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this!
Describe your changes
Before
Screenbox_Header_Old.mp4
After
Screenbox_Header.mp4
Note
This area still needs more work.
Screenbox_TextSize.mp4
Screenbox_NavView_Theme.mp4
Screenbox_Button_Theme.mp4