Skip to content

feat: Update RatingControl to winui3/release/1.7.3 #21181

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

MartinZikmund
Copy link
Member

@MartinZikmund MartinZikmund commented Jul 31, 2025

GitHub Issue: related to #21148
related to unoplatform/uno.chefs#1668

PR Type:

What is the current behavior? πŸ€”

What is the new behavior? πŸš€

PR Checklist βœ…

Please check if your PR fulfills the following requirements:

Other information ℹ️

@Copilot Copilot AI review requested due to automatic review settings July 31, 2025 13:16
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 updates the RatingControl implementation to align with WinUI 3 release version 1.7.3, modernizing the control's sizing and layout behavior.

Key changes:

  • Replaced hardcoded values with resource-based configuration for font size, item spacing, and caption margins
  • Improved sizing calculations to support dynamic text scaling and better layout positioning
  • Added new test coverage for verifying resource-based size changes

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
RatingControl.mux.cs Core implementation updated with resource-based sizing, improved layout calculations, and removed text scale factor handling
RatingControl.h.mux.cs Added new private fields for resource management and transform handling
RatingControlTests.cs New test method to verify dynamic sizing behavior through resource changes
themeresources_v2.xaml Updated control template with new styling approach and resource references
RatingControl_themeresources.xaml Added resource definitions for font size, item spacing, and caption margins
RatingControl.xaml Template changes matching the main theme resources file

Comment on lines 888 to 891

m_mousePercentage = (double)(xPosition) / CalculateActualRatingWidth();
m_mousePercentage = (xPosition - m_firstItemOffset) / CalculateActualRatingWidth();

UpdateRatingItemsAppearance();
args.Handled = true;
UpdateRatingItemsAppearance();
Copy link
Preview

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

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

Potential division by zero if CalculateActualRatingWidth() returns 0. This could occur when MaxRating is 0 or ActualRatingFontSize() returns 0. Consider adding a check to prevent division by zero.

Copilot uses AI. Check for mistakes.

@unodevops
Copy link
Contributor

πŸ€– Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21181/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

πŸ€– Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21181/docs/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 172490 has failed on Uno.UI - CI.

@MartinZikmund MartinZikmund force-pushed the dev/mazi/rating-control-update branch from 9e57dc2 to f3fcc27 Compare August 1, 2025 07:16
@unodevops
Copy link
Contributor

πŸ€– Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21181/docs/index.html

@unodevops
Copy link
Contributor

πŸ€– Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21181/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 172552 has failed on Uno.UI - CI.

@MartinZikmund MartinZikmund force-pushed the dev/mazi/rating-control-update branch from f3fcc27 to 7081d54 Compare August 2, 2025 08:09
@unodevops
Copy link
Contributor

πŸ€– Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21181/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

πŸ€– Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21181/docs/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 172650 has failed on Uno.UI - CI.

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.

2 participants