This repository was archived by the owner on Jun 5, 2025. It is now read-only.
Scale widget size with system Text Size#2723
Merged
Conversation
guimafelipe
approved these changes
Apr 22, 2024
dhoehna
reviewed
Apr 23, 2024
tools/Dashboard/DevHome.Dashboard/Controls/WidgetControl.xaml.cs
Outdated
Show resolved
Hide resolved
dhoehna
reviewed
Apr 23, 2024
| private SelectableMenuFlyoutItem _currentSelectedSize; | ||
|
|
||
| [ObservableProperty] | ||
| private GridLength _headerHeight; |
Contributor
There was a problem hiding this comment.
Technically, these attributes should only be in ViewModels because the view should have no logic besides showing the view.
However, these members control the view and make the view simpler to understand.
I don't know when too much spillover of [ObservableProperty] into the view is too much.
But. I'm not blocking on this. Just a though.
dhoehna
reviewed
Apr 23, 2024
|
|
||
| private async void OpenWidgetMenuAsync(object sender, RoutedEventArgs e) | ||
| { | ||
| if (sender as Button is Button widgetMenuButton) |
Contributor
There was a problem hiding this comment.
sender as button widgetMenuButton would work here, ya?
Collaborator
Author
There was a problem hiding this comment.
I think this way protects against the null case. And if (sender as Button widgetMenuButton) doesn't work because it doesn't evaluate to a boolean.
dhoehna
approved these changes
Apr 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the pull request
There are a few accessibility bugs around text being cut off inside widgets when system text scaling is turned up (Windows Settings > Accessibility > Text size). The Windows Widget Board (

🪟+w) scales up the entire widget to match the text scaling, so we will, too. For example, the normal widget width is 300 pixels. If text scaling is at 200%, our widgets will become 600 px wide. Height also scales.References and relevant issues
https://task.ms/49360547
https://task.ms/49658528
Detailed description of the pull request / Additional comments
GetPixelHeightFromWidgetSizemoves to WidgetControl since that is the only place it is used.Validation steps performed
PR checklist