-
Notifications
You must be signed in to change notification settings - Fork 3
[MacOS] Fix inconsistent response to custom height across controls #334
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
Conversation
704e2c7 to
2b4439e
Compare
2b4439e to
909f349
Compare
fc6834a to
bb5336b
Compare
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 addresses inconsistent behavior across MacOS controls when custom heights are set. The fix ensures all controls grow to the requested size while reserving 3px margins for focus highlights, preventing visual clipping or bleeding. The approach standardizes the behavior so controls maintain self-contained rendering with proper focus border spacing.
Key changes:
- Removed explicit height bindings from internal border elements in TextBox and TagInput controls
- Changed margin resource references from
StaticResourcetoDynamicResourcefor consistency - Added explicit height binding to NumericUpDown's inner TextBox
- Updated MultiComboBox horizontal alignment to
Stretchfor better layout behavior
Reviewed changes
Copilot reviewed 16 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
TextBox.axaml |
Removed Height bindings from internal borders and changed margin to DynamicResource |
TagInput.axaml |
Removed Height binding from border and updated margin resource reference |
RadioButton.axaml |
Changed margin resource reference to DynamicResource |
NumericUpDown.axaml |
Added Height binding to PART_TextBox for consistency |
MultiComboBox.axaml |
Changed HorizontalAlignment to Stretch and margin to DynamicResource |
Devolutions.AvaloniaTheme.MacOS.csproj |
Updated release notes and cleaned up XML formatting |
| Visual test baselines | Updated PNG screenshots to reflect new control rendering behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This fixes a number of inconsistencies across MacOS controls in how they respond to explicit height settings.
Before: some controls did not respond at all, some grew to the set size but lost their margins, potentially leading to focus highlight being cut off, some grew overall to the requested size leaving room for the margins (so the visible size is 3px less)
After: I have now taken the latter approach for all controls.
While it might seem slightly confusing that a "30px" control has a visible height of 27px, it guarantees that the control is self-contained and won't visually bleed over other controls or get clipped unexpectedly.
Consumers will need to account for the margin (e.g. set
Height="33"to achieve 30 for the unfocussed visual appearance), or don't set a height at all and let the theme dictate the natural size (which is usually the best practice).