Fix VerticalTextAlignment Override not being set when initializing #626
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.
As noted in #616, text alignment was not properly centered on non-Windows systems - even if using the
TextVerticalAlignmentOverrideBehavior
property onFluentAvaloniaTheme
. This issue was caused because FATheme gets initialized before any properties set in Xaml are set (init in ctor). This issue dates back to when FATheme was forcibly moved to a Xaml file to accommodate AOT, so its apparently been around a while.I've adjusted the property setter to call the method that activates the special styles so that it calls. Note, at runtime you can only turn on the override. Setting the property to turn it off will do nothing - so it still should be treated as a start-up only property. I also adjusted one of styles to correct for
ComboBox
.Fixes #616
Note: I've tested with a non Segoe font on Windows and it is resolved, but if someone is able to test this branch on Linux or Mac without a package, please let me know if this fixes the issue.