-
Notifications
You must be signed in to change notification settings - Fork 36
Implemented feature to gray out all controls if they are disabled #59
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
Conversation
flabbet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks like it should work, but I tried running ColorPickerDemo and changed IsEnabled=False on StandardColorPicker PortableColorPicker, but nothing grayed out. Is there something I am missing out?
|
Uhm I set IsEnabled=False on the MainWindow and then it worked for me. I tried that now again. But I will check it why this could not work. Edit: Ah ok, I think I know the issue. I updated the WPF controls but not the AvaloniaUI controls. I will fix and commit that. |
|
Ok, it was actually as I thought: I forgot to also implement this feature in the AvaloniaUI control. Now they also gray out if they are disabled. |
|
The issue is not related to Avalonia. I tested WPF demo project. Although thank you for implementing that too. My problem was that setting IsEnabled to individual controls do not make them grayed out. I did not test setting IsEnabled to whole window. I'll check if everything works with avalonia later |
|
Ahh ok. Then I will check that again if I missed something. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it works, no idea why it didn't before. Overall looks good, just remove the comment
| </Setter> | ||
| </ControlTheme> | ||
|
|
||
| <!-- Style für disabled State: Graustufen-Bild verwenden --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not include comments in german
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, my bad. Sorry, that I added this comment in german. I now removed it.
flabbet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thank you

The current color controls keep their state even if they are disabled. However, this can be confusing for users because there is no visual feedback that the controls are disabled. This PR changes this behavior by using the luminance of a color as the gray value.
Enabled Controls
Disabled Controls
Breaking Changes
This PR changes the visual behavior of the color controls so if developers used the disabled state to just display the color, this PR will break this. However, I would argue that the color controls are primarily to control the color values and not just to display them. If such a display option is needed, an additional "KeepColorWhileDisabled" DP could be added to the controls.