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

Controls Enabled / Disabled #8

Open
m-pravato opened this issue Jun 16, 2021 · 2 comments
Open

Controls Enabled / Disabled #8

m-pravato opened this issue Jun 16, 2021 · 2 comments

Comments

@m-pravato
Copy link

hello Angry

I noticed that the Disabled state of the Controls looks inconsistent, excuse the term, with the default (grayed out) behavior.
This makes the Controls appear to be Active even if Disabled.
I investigated a bit and it seems to be due to the style defined for the TextBlock:

<! - Textblock ->
<Style TargetType = "{x: Type TextBlock}">
    <Setter Property = "TextWrapping" Value = "NoWrap" />
    <Setter Property = "TextTrimming" Value = "CharacterEllipsis" />
    <Setter Property = "TextAlignment" Value = "Left" />
    <Setter Property = "Foreground" Value = "{StaticResource ControlDefaultForeground}" />
</Style>

As I understand it, the TextBlock is implicitly used for the ContentPresenter of the various Controls and therefore its Foreground overwrites the color that You had foreseen (ControlDisabled ...).
After some research I found what appears to be the solution:
use the Opacity Property of the Control instead of setting the properties of the various components defined in the ControlTemplate:

    <Style.Triggers>
        <Trigger Property = "IsEnabled" Value = "False">
            <Setter Property = "Opacity" Value = ". 5" />
        </Trigger>
    </Style.Triggers>

In this way it seems to me that the result is better

@m-pravato
Copy link
Author

a couple of screenshots to explain me better :

current behavior :
Light_0

modified behavior:
Light_1

@AngryCarrot789
Copy link
Owner

ah i see. ill add this to the next update along with the automatic menuitem solution you came up with :) thanks

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

No branches or pull requests

2 participants