Skip to content
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

Merged
merged 9 commits into from
May 29, 2024

Conversation

United600
Copy link
Collaborator

@United600 United600 commented May 15, 2024

Describe your changes

  • Adds visual feedback to ListView/GridView headers

Before

Screenbox_Header_Old.mp4

After

Screenbox_Header.mp4
  • Improved accessibility text size support

Note

This area still needs more work.

Before After
Text Size Before Text Size After
Screenbox_TextSize.mp4
  • Tweaked GridViewItem hover brushes
Before After
Dark Grid View Item Before Dark Grid View Item After
Light Grid View Item Before Light Grid View Item After
High Contrast Grid View Item Before High Contrast Grid View Item After
  • Adds margins between ListView item on Windows 10
  • Improvements to GridViewItem hover state on Windows 10
  • High Contrast improvements to ListViewItem TextBlock hover state
Before After
High Contrast ListViewItem PointerOver Before Hight Contrast ListViewItem PointerOver After
  • Fix some theme switching problems
Screenbox_NavView_Theme.mp4
Screenbox_Button_Theme.mp4

@United600 United600 added the a11y Issues with navigation interactions, screen readers, contrast, text sizes and other areas label May 15, 2024
Copy link
Owner

@huynhsontung huynhsontung left a 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.

Screenbox/Pages/NetworkPage.xaml Outdated Show resolved Hide resolved
Comment on lines +10 to +12
<!-- 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>
Copy link
Owner

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! 🤩

Comment on lines +419 to +445
<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>
Copy link
Owner

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.

Copy link
Collaborator Author

@United600 United600 May 16, 2024

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">
Copy link
Owner

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?

Copy link
Collaborator Author

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):

<Thickness x:Key="PageThumbnailMargin">52,0</Thickness>

Copy link
Owner

@huynhsontung huynhsontung May 18, 2024

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.

Screenbox/Styles/ItemContainer.xaml Outdated Show resolved Hide resolved
United600 added 3 commits May 20, 2024 01:22
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
Copy link
Owner

@huynhsontung huynhsontung left a 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!

@huynhsontung huynhsontung merged commit dc4717f into huynhsontung:main May 29, 2024
4 checks passed
@United600 United600 deleted the resources branch May 29, 2024 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Issues with navigation interactions, screen readers, contrast, text sizes and other areas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants