Open robloo opened 1 year ago
I suppose it could be possible this has something to do with the async rendering or time it takes to generate the background gradient. Technically it is being calculated for two property changes very rapidly (ColorModel and IsPerceptive). It still feels like something is wrong with the property system but that's an alternative to investigate further.
I haven't been able to check this issue last week. Hopefully I will have time tomorrow, if nothing else will come up to work on.
I don't think it's something with async rendering, as even in dev tools IsPerceptive value is changing randomly. And set "Priority" is just lying there. I.e. it can say "LocalValue", when I removed local value from the ColorView.xaml and it could only be either Unset (=true by default) or set from style trigger (false). And style is not applied when it is expected to.
Added pseudoclasses to see if it helps to find a problem. Apparently there is something with dev tools or we got quantum mechanics observer effect. Selecting node in the dev tools tree changes its behavior.
https://github.com/AvaloniaUI/Avalonia/assets/3163374/56a25829-c822-4484-895b-276c6358f4b2
That's really strange, glad this is reproducible though. I'm away from a computer for the next few days but will be back to this shortly. Not sure how much I can help here though as it seems deep in the property and styling system.
Describe the bug
To Reproduce
I'm merging the reproduction, expected behavior and screenshots sections together to make this easier to follow. There are a few different cases here.
Firstly, this was encountered with the #11264 PR so all repro should use that branch.
Within ColorView (a normal control scenario) the following selectors are applied intermittently.
https://user-images.githubusercontent.com/17993847/236684642-705d5651-e006-4933-942b-89545e7167ed.mp4
Note that switching between Hsva and Rgba color models should apply/remove the style accordingly. This works sometimes but other times does not. There seems to be no clear pattern here. In the screen capture this is made visible by the slider gradient backgrounds changing color even with the same color model (clearest to see in RGB where if
IsPerceptive=True
the gradients will ONLY be red/green/blue).Within
ColorPicker
-- a control with the majority of its content hosted within a popup/flyout -- NONE of the selectors seem to be applied. This includes one more selector that works inColorView
.https://user-images.githubusercontent.com/17993847/236684791-068b7b43-64f3-4992-af94-b6c6667b777f.mp4
This is NOT intermittent and just always fails to apply the selectors within a popup/flyout. The RGB component sliders should not be red/green/blue (IsPerceptive=True) they should appear as the sliders in the ColorView visible before the popup/flyout is opened.
Desktop (please complete the following information):
Additional context Add any other context about the problem here.