Adjust macOS Tray/Menu icons scaling #19628
Merged
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.

Fixes #18896
What does the pull request do?
This PR adjusts the scaling behavior for macOS Tray and Menu images to round down the scaling to a whole number.
What is the current behavior?
The logic in menu.mm and tray icon.mm tries to set the height and width of the menu image based on the menu font size. This would, generally, over-scale the image, both cutting it off and making it blurry.
What is the updated/expected behavior with this PR?
I've added a floor to it so now it will scale down to a whole number. This keeps the existing-ish logic and should fix it so it won't be blurry and cut off.
The scaling logic can't be fully removed because that would be a breaking change. NSStatusBar does allow for variable size icons that are not square and more could be done to allow for directly setting sizes, but I feel this is the least destructive way to handle it for now that should fix the general issue.