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

Feature: Improved visual elements in the content area #13054

Closed
wants to merge 10 commits into from

Conversation

0x5bfa
Copy link
Member

@0x5bfa 0x5bfa commented Jul 24, 2023

Feature: Improved visual elements in the content area

Motivation & Context

  • Improved DataGridHeader control
  • Improved divider controls in High Contrast (red to white in dark HC mode)
  • Improved divider margin

PR Checklist

  • Were these changes approved in an issue or discussion with the project maintainers? In order to prevent extra work, feature requests and changes to the codebase must be approved before the pull request will be reviewed. This prevents extra work for the contributors and maintainers.
    Closes Bug: Divider color is red in High Contrast #13077
    Closes Bug: Backplates will be displayed when hovering in High Contrast #13078
  • Did you build the app and test your changes?
  • Did you check for accessibility? You can use Accessibility Insights for this.
  • Did you remove any strings from the en-us resource file?
    • Did you search the solution to see if the string is still being used?
  • Did you implement any design changes to an existing feature?
    • Was this change approved?
  • Are there any other steps that were used to validate these changes?

Screenshots

None

@mdtauk
Copy link
Contributor

mdtauk commented Jul 25, 2023

image

@mdtauk
Copy link
Contributor

mdtauk commented Jul 25, 2023

High Contrast

image

@0x5bfa
Copy link
Member Author

0x5bfa commented Jul 25, 2023

image
image
image

A bit off? if so, padding should be 17 from 16.
image

@mdtauk
Copy link
Contributor

mdtauk commented Jul 25, 2023

image !

The text should not have a backplate in High Contrast.

Some time ago the WinUI team took steps to fix these issues
microsoft/microsoft-ui-xaml#1663 (comment)

@0x5bfa
Copy link
Member Author

0x5bfa commented Jul 25, 2023

There's a lot of backplates in Files. that improvement should be out of the scope but I can if yair'd like.

image

Adding HighContrastAdjustment="None" will fix, then?

@0x5bfa 0x5bfa changed the title Feature: Replace DataGridHeader with ResourceDicrionary-based one Feature: Improved visual elements in the content area Jul 25, 2023
@mdtauk
Copy link
Contributor

mdtauk commented Jul 25, 2023

There's a lot of backplates in Files. that improvement should be out of the scope but I can if yair'd like.

image

Adding HighContrastAdjustment="None" will fix, then?

I am not sure of the technical detail, only that it was a change made in preparation for Windows 11.

https://learn.microsoft.com/en-gb/uwp/api/windows.ui.xaml.uielement.highcontrastadjustment?view=winrt-22621

The change should be made across most of Files' UI in High Contrast

@0x5bfa 0x5bfa marked this pull request as ready for review July 25, 2023 15:52
@yaira2
Copy link
Member

yaira2 commented Jul 25, 2023

@0x5bfa can you link the issue/feature request for this PR?

@0x5bfa
Copy link
Member Author

0x5bfa commented Jul 26, 2023

  • Adjust placements of datagrid.
  • See that was really fixed.

@@ -122,7 +122,7 @@
<icore:ChangePropertyAction
PropertyName="CurrentInstanceBorderBrush"
TargetObject="{Binding ElementName=PaneLeft}"
Value="{ThemeResource ControlStrokeColorDefault}" />
Value="{ThemeResource DividerStrokeColorDefaultBrush}" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? I think we need a custom brush so that we have the correct color in each theme.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've confirmed that brush is appropriate in light(light dark), dark(light dark), high contrast(white). But previous one was red in hc theme. but we probably need to wrap this brush like App.Theme.DividerStrokeColorDefaultBrush.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but we probably need to wrap this brush like App.Theme.DividerStrokeColorDefaultBrush.

That was my assumption

@@ -2,7 +2,8 @@
<Application
x:Class="Files.App.App"
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"
HighContrastAdjustment="None">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this property do?

Copy link
Contributor

@mdtauk mdtauk Jul 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this property do?
It is used to remove the backplate from text inside elements - but when activated, you will need to make sure every element has the correct foreground colour with the background colours.

https://learn.microsoft.com/en-gb/uwp/api/windows.ui.xaml.uielement.highcontrastadjustment?view=winrt-22621

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

written in the remarks section.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdtauk adding it in the app.xaml doesn't work. so added each page, i confirmed they are at work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's hold off on this change, I think we need to do some testing to see how it affects the rest of the app.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can test in this PR. This PR's purpose is to improve visual elements and so I think it is not out of the scope of the PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I tested in the contents area and the settings area. The controls from MUXC like TabView has already applied this property in the custom style (custom TabView style).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdtauk adding it in the app.xaml doesn't work. so added each page, i confirmed they are at work.

This seems to be a bug, do you know if it's reported on the WinUI repo yet?

@Jay-o-Way

This comment was marked as off-topic.

@yaira2
Copy link
Member

yaira2 commented Jul 26, 2023

@Jay-o-Way we're well aware of this recommendation and we follow it around 95% of the time, but it's not always possible and it doesn't always make sense. As a side point, it's worth mentioning that according to WinUI, this rule doesn't apply anymore but we still follow it for consistency.

@0x5bfa

This comment was marked as off-topic.

@mdtauk
Copy link
Contributor

mdtauk commented Jul 27, 2023

FYI

Note If you do use measurement values, all dimensions, margins, and padding should be in increments of 4 epx. When XAML uses effective pixels and scaling to make your app legible on all devices and screen sizes, it scales UI elements by multiples of 4. Using values in increments of 4 results in the best rendering by aligning with whole pixels.

https://learn.microsoft.com/windows/apps/design/layout/alignment-margin-padding

I have been sure to adhere to this with the designs. Occasionally like with the sidebar items, we have 2px for top and bottom padding - so when stacked vertically, you get a 4px gap between items. So you will see raw values in xaml that are not in multiples of 4, but when placed into the layouts, will in fact, meet this expectation.

@@ -26,6 +27,10 @@
<CornerRadius x:Key="GridViewThumbnailCornerRadius">2</CornerRadius>
<CornerRadius x:Key="DetailsLayoutThumbnailCornerRadius">2</CornerRadius>

<Style TargetType="FlyoutPresenter">
<Setter Target="HighContrastAdjustment" Value="None" />
</Style>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's hold off on this change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I fixed #13128 here lol

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

@0x5bfa 0x5bfa closed this Aug 25, 2023
@0x5bfa 0x5bfa deleted the 5bfa/Update-DataGridHeader branch September 16, 2023 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Backplates will be displayed when hovering in High Contrast Bug: Divider color is red in High Contrast
4 participants