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

RatingControl: Fix visibility issues of unselected stars in new style #3930

Conversation

marcelwgn
Copy link
Contributor

@marcelwgn marcelwgn commented Jan 12, 2021

Description

Switches the unset glyph and updates the unset foreground color.

Motivation and Context

Closes #3925

How Has This Been Tested?

Image showing different RatingControls in light theme with unselected stars being visible

Image showing different RatingControls in darktheme with unselected stars being visible

Screenshots (if appropriate):

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Jan 12, 2021
@marcelwgn
Copy link
Contributor Author

@YuliKl Do we also need to update the caption foreground color? In it's current state it is definitely not adhering to a11y standards.

@YuliKl
Copy link

YuliKl commented Jan 12, 2021

@YuliKl Do we also need to update the caption foreground color? In it's current state it is definitely not adhering to a11y standards.

Yes, thank you for catching that! Will find the correct new color momentarily.

@YuliKl
Copy link

YuliKl commented Jan 12, 2021

@chingucoding the caption text should also use TextFillColorSecondaryBrush just like the stars. Thank you!

@marcelwgn
Copy link
Contributor Author

Thank you @YuliKl. I updated the template to set the caption foreground appropriately (screenshots updated at the top of the PR).

@ranjeshj
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@StephenLPeters StephenLPeters added area-RatingControl team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Jan 13, 2021
@@ -52,7 +52,10 @@

<StackPanel Orientation="Horizontal" Grid.Row="0" Margin="-20,-20,-20,-20">
<StackPanel x:Name="RatingBackgroundStackPanel" Orientation="Horizontal" Background="Transparent" Margin="20,20,0,20"/>
<TextBlock x:Name="Caption" Height="32" Margin="4,9,20,0" TextLineBounds="TrimToBaseline" Style="{ThemeResource CaptionTextBlockStyle}" VerticalAlignment="Center" AutomationProperties.AccessibilityView="Raw" AutomationProperties.Name="RatingCaption" IsHitTestVisible="False" Text="{TemplateBinding Caption}"/>
<TextBlock x:Name="Caption" Height="32" Margin="4,9,20,0" TextLineBounds="TrimToBaseline" Style="{ThemeResource CaptionTextBlockStyle}"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Copy link
Contributor

Choose a reason for hiding this comment

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

A new static resource can be created for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given that this TextBlock uses the CaptionTextBlockStyle would it be even better to alter that style? The only issue is that we would need to put that into WinUI as it currently isn't in the WinUI 2 codebase I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@YuliKl What do you think? Would it be better to adjust the CaptionTextBlockStyle or just fix this on the RatingControl here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just noticed we already have a brush for this, updated that now. Ignore my last two comments.

Copy link

Choose a reason for hiding this comment

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

The color value shouldn't be part of CaptionTextBlockStyle, that style primarily captures the correct font size (and a few other incidental properties). So I don't think it makes sense to modify CaptionTextBlockStyle for this particular scenario.

You could make a RatingControlCaptionStyle based on CaptionTextBlockStyle. Not sure if the overhead is worth it but maybe that's what @karenbtlai is suggesting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue was that at the top of RatingControl, we set the foreground color to RatingControlCaptionForeground which had a faulty value. Changing that brushes value to the specified value fixed the issue. CaptionTextBlockStyle should be fine. Sorry about the confusion.

Copy link
Contributor

Choose a reason for hiding this comment

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

I apologize for the ambiguity in my comments. I meant the referenced ThemeResource in Foreground can reference a new static resource rather than the brush directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I see. Is the current setup using the RatingControlCaptionForeground fine?

@ranjeshj
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ranjeshj
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ranjeshj ranjeshj merged commit 29e8b9d into microsoft:master Jan 19, 2021
@marcelwgn marcelwgn deleted the user/chingcoding/ratingcontrol-newstyle-fixes branch March 8, 2021 22:17
Kinnara added a commit to Kinnara/ModernWpf that referenced this pull request Jul 10, 2022
Kinnara added a commit to Kinnara/ModernWpf that referenced this pull request Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-RatingControl team-Controls Issue for the Controls team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RatingControl color fix
5 participants