-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Expander styles broken when using Simple Theme #10226
Comments
See here: #10237 (comment) It is likely all related. |
I saw that and thought the same, but then tried reverting the changes in the PR and nothing apparently changed. |
After investigating a bit more, I suspect it may be related to Relevant codeSimple theme control template:
Simple theme setter for Avalonia/src/Avalonia.Themes.Simple/Controls/Expander.xaml Lines 155 to 157 in d8cdac1
Fluent theme setter for Avalonia/src/Avalonia.Themes.Fluent/Controls/Expander.xaml Lines 314 to 316 in d8cdac1
Additionally, I believe that the theme setter should have no effect because it has lower priority than the local value in the control template, but not sure if priorities behave the same in control themes. Also tried moving from local value to "default" style (i.e. without |
I think I finally understand what's happening. The template changes, but the selectors are applied before the template is applied, so the styles are applied to the old template and not the new one. I could fix it by adding Avalonia/src/Avalonia.Controls/Primitives/TemplatedControl.cs Lines 399 to 412 in 87af060
Not sure if this is a fix or a hack though, could someone please confirm? Maybe @maxkatz6 or @grokys? |
Describe the bug
Expanding an expander breaks its styles. This bug only seems to occur when using the Simple Theme. I could only create a simple repro for pointer over styles not working, although the original bug is that the list box would measure 0 height after the expander is expanded at least once. I believe it's the same bug.
To Reproduce
Steps to reproduce the behavior:
Sandbox
Expected behavior
Expander's border color should change according to pointer over, even after expanding it at least once.
Screenshots
styles-bug-repro.mp4
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: