Skip to content

Rename Fluent resources according to general convention #10898

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

Merged
merged 1 commit into from
Jun 3, 2025

Conversation

harshit7962
Copy link
Member

@harshit7962 harshit7962 commented May 30, 2025

Fixes #9987

Description

The PR addresses the inaccurate naming of certain resources according to their WinUI counterparts. This to a lot of extent addresses the concerns raised in the above mentioned issue. The previously used resource keys are not removed to avoid breaking changes and is included at the end of each color files.

Customer Impact

Newly introduced resource keys which are easy to infer and follows a similar naming convention

Regression

No

Testing

Local Build pass
Tested the controls which had the updates

Risk

Low

Microsoft Reviewers: Open in CodeFlow

@Copilot Copilot AI review requested due to automatic review settings May 30, 2025 12:26
@harshit7962 harshit7962 requested a review from a team as a code owner May 30, 2025 12:26
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR renames several Fluent resource keys so that they align with the WinUI naming conventions while preserving the old keys as deprecated entries.

  • Renames CalendarViewButtonForeground to CalendarViewNavigationButtonForeground across themes and styles.
  • Renames DatePickerFocusedBorderBrush to DatePickerBorderBrushFocused and MenuBarItemBackgroundMousePointer to MenuBarItemBackgroundPointerOver.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Themes/Fluent.xaml Updated button foreground resource key in the base Fluent theme.
Themes/Fluent.Light.xaml Renamed resource keys for navigation button, date picker border, and menu bar pointer in the light theme.
Themes/Fluent.HC.xaml Updated the key for navigation button foreground in the high contrast theme.
Themes/Fluent.Dark.xaml Revised resource keys to follow the new naming conventions in the dark theme.
Styles/Calendar.xaml Updated the Calendar style to reference the new navigation button foreground key.
Resources/Theme/Light.xaml Renamed keys in the light theme resource dictionary for consistency.
Resources/Theme/HC.xaml Aligned the high contrast theme resource keys with the new naming conventions.
Resources/Theme/Dark.xaml Updated dark theme resource keys to reflect the naming changes.
Comments suppressed due to low confidence (10)

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.xaml:393

  • Ensure that the new resource key 'CalendarViewNavigationButtonForeground' is consistently defined and referenced across all Fluent themes.
<Button x:Name="PART_PreviousButton" Grid.Column="1" Width="26" Height="26" Margin="7,6,7,7" Padding="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Transparent" BorderBrush="Transparent" Focusable="True" AutomationProperties.Name="Previous" Foreground="{DynamicResource CalendarViewNavigationButtonForeground}">

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.Light.xaml:418

  • Verify that 'CalendarViewNavigationButtonForeground' aligns with naming conventions in all theme files.
<SolidColorBrush x:Key="CalendarViewNavigationButtonForeground" Color="{StaticResource TextFillColorSecondary}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.Light.xaml:515

  • Ensure that 'DatePickerBorderBrushFocused' is consistently renamed across all themes to reflect its intended purpose.
<SolidColorBrush x:Key="DatePickerBorderBrushFocused" Color="{StaticResource SystemAccentColorDark1}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.Light.xaml:605

  • Confirm that 'MenuBarItemBackgroundPointerOver' is used uniformly in the light theme for hover states.
<SolidColorBrush x:Key="MenuBarItemBackgroundPointerOver" Color="{StaticResource SubtleFillColorTertiary}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.HC.xaml:266

  • Confirm that 'CalendarViewNavigationButtonForeground' is used consistently in the high contrast theme.
<SolidColorBrush x:Key="CalendarViewNavigationButtonForeground" Color="{StaticResource SystemColorButtonTextColor}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.Dark.xaml:409

  • Ensure that the renamed key 'CalendarViewNavigationButtonForeground' is maintained consistently in the dark theme.
<SolidColorBrush x:Key="CalendarViewNavigationButtonForeground" Color="{StaticResource TextFillColorSecondary}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/Calendar.xaml:356

  • Check that the Calendar control's button foreground now uses 'CalendarViewNavigationButtonForeground' for consistency.
Foreground="{DynamicResource CalendarViewNavigationButtonForeground}">

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Light.xaml:413

  • Ensure that the updated key 'CalendarViewNavigationButtonForeground' is propagated correctly in the light theme resource dictionary.
<SolidColorBrush x:Key="CalendarViewNavigationButtonForeground" Color="{StaticResource TextFillColorSecondary}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/HC.xaml:233

  • Confirm consistent naming of navigation button foreground in the high contrast theme resource dictionary.
<SolidColorBrush x:Key="CalendarViewNavigationButtonForeground" Color="{StaticResource SystemColorButtonTextColor}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Dark.xaml:404

  • Verify that 'CalendarViewNavigationButtonForeground' is used as per the new naming convention in the dark theme resource file.
<SolidColorBrush x:Key="CalendarViewNavigationButtonForeground" Color="{StaticResource TextFillColorSecondary}" />

@dotnet-policy-service dotnet-policy-service bot added the PR metadata: Label to tag PRs, to facilitate with triage label May 30, 2025
Copy link

codecov bot commented May 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 2.98814%. Comparing base (1642c81) to head (8b2288f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##               main     #10898   +/-   ##
===========================================
  Coverage   2.98814%   2.98814%           
===========================================
  Files          3319       3319           
  Lines        664895     664895           
  Branches      74675      74675           
===========================================
  Hits          19868      19868           
  Misses       644846     644846           
  Partials        181        181           
Flag Coverage Δ
Debug 2.98814% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dipeshmsft dipeshmsft merged commit 7999e6d into dotnet:main Jun 3, 2025
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fluent2 Menu/MenuItem Resource Keys Misnamed
2 participants