MaterialDesignInXAML / MaterialDesignInXamlToolkit

Google's Material Design in XAML & WPF, for C# & VB.Net.
http://materialdesigninxaml.net
MIT License
14.82k stars 3.4k forks source link

Fix smart hint resting opacity and (input control) enabled/disabled state #3575

Closed nicolaihenriksen closed 1 month ago

nicolaihenriksen commented 1 month ago

Related to #3564 (only a partial fix)

The issue above mentions some discrepancies regarding the color/dimming of the hint text which this PR addresses. While looking at it, I also found a number of discrepancies in the disabled state of the styles, so I decided to align those as well.

To play around with it yourself, use the Smart Hint demo app page where you can toggle the IsEnabled state and also test the focused/unfocused states.

The (floating) hint basically has 3 states: resting-unfocused, floating-focused, and floating-unfocused. There was really only an issue in the first of these states, and the fix can be seen below (dimming the hint); aligned across all the input controls using SmartHint

Before

image

After

image


Regarding IsEnabled=False (and even some colors in enables states as well) there were a number of issues. Much of it stems from the fact that we're using Opacity to represent disabled state, and we often end up with multiple layers of Opacity causing certain elements to be more/less opaque than others.

There is also a quirk to the new flexible theming systems where some "disabled" brushes are directly exposed. This leads the consumer to expect they can set a specific color/brush, but it some cases that color/brush may be dimmed down with one or more levels of Opacity being applied.

I have aligned colors and opacity levels as best as I could, and I believe it is much closer to what we want now; this has also been aligned across all the input controls using SmartHint.

Before

Enabled Disabled
image image

After

Enabled Disabled
image image