Skip to content
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

Fix VerticalTextAlignment Override not being set when initializing #626

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amwx
Copy link
Owner

@amwx amwx commented Dec 1, 2024

As noted in #616, text alignment was not properly centered on non-Windows systems - even if using the TextVerticalAlignmentOverrideBehavior property on FluentAvaloniaTheme. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Text alignment is not vertically centered in MacOS, Linux
1 participant