-
Notifications
You must be signed in to change notification settings - Fork 802
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 |
src/Uno.UI/Microsoft/UI/Xaml/Controls/RatingControl/RatingControl.mux.cs
Outdated
Show resolved
Hide resolved
|
||
m_mousePercentage = (double)(xPosition) / CalculateActualRatingWidth(); | ||
m_mousePercentage = (xPosition - m_firstItemOffset) / CalculateActualRatingWidth(); | ||
|
||
UpdateRatingItemsAppearance(); | ||
args.Handled = true; | ||
UpdateRatingItemsAppearance(); |
There was a problem hiding this comment.
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.
src/Uno.UI.RuntimeTests/MUX/Microsoft_UI_Xaml_Controls/RatingControl/RatingControlTests.cs
Show resolved
Hide resolved
src/Uno.UI.RuntimeTests/MUX/Microsoft_UI_Xaml_Controls/RatingControl/RatingControlTests.cs
Show resolved
Hide resolved
π€ 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 |
π€ Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21181/docs/index.html |
|
9e57dc2
to
f3fcc27
Compare
π€ Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21181/docs/index.html |
π€ 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 |
|
f3fcc27
to
7081d54
Compare
π€ 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 |
π€ Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21181/docs/index.html |
|
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:
Screenshots Compare Test Run
results.Other information βΉοΈ