-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Color picker fixes #4134
Color picker fixes #4134
Conversation
Thanks robloo for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
@@ -216,6 +220,7 @@ protected override void OnApplyTemplate() | |||
|
|||
base.OnApplyTemplate(); | |||
this.UpdateVisualState(false); | |||
this.ValidateSelectedPanel(); |
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.
There is an issue with validating and updating the selected panel only here. If the IsColorSpectrumVisible
or IsColorChannelTextInputVisible
properties are changed after the template is applied the selected tab may become invalid. This is because the base WinUI ColorPicker is currenlty responsible for updating the visual state that actually applies tab visibility for these two (it is all done in the style). Only IsColorPaletteVisible
is managed by the derived toolkit ColorPicker. To fix this:
- Need to monitor for property changes on these properties as well, or
- Need to connect to VisualState changed events -- there are more than one and this is a bit ugly.
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.
This is an existing issue, correct?
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.
Yes, I was waiting to see if its considered enough of an issue to fix. The changes now will work as long as the properties are updated in XAML which is by far the largest use case.
Overall the selection fix exposes an inconvenience with separating a selection control (ListBox) from the presenter content control (SwitchPresenter). Ideally, the control responsible for selection could be smart enough to ensure the selected item is actually visible. It is a bit more complex to do this in the control itself and obviously isn't general purpose. A nice 'Tab' control to handle this case would be better in my opinion. |
This improves the design when some tabs are hidden
This fixes potential issues with shared instances of the brush
Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker/ColorPickerSlider.xaml
Show resolved
Hide resolved
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.
It seems the new example is covering an existing one.
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/ColorPicker/ColorPickerButtonXaml.bind
Outdated
Show resolved
Hide resolved
@robloo couple of open questions and a small fix to the sample when you have a chance, thanks! |
@michael-hawker Looks like there are a lot more changes to the template than I initially thought. You really moved a lot of things around when you broke up ColorPicker and ColorPickerButton. One of the things you removed appears to be the drop shadow behind the primary preview color (the one in the center). I'm planning to add this drop shadow back unless you had a good reason for taking it out. The comments look like you just forgot to add it back. WindowsCommunityToolkit/Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker/ColorPicker.xaml Lines 453 to 461 in 5171b99
Otherwise, I should get to finishing the PR next week. |
@michael-hawker Sure, I'll wait until the new drop shadow methodology is in place. It's good there is advancement in this area! I also read you are updating to 2.6 styles so I can include the drop shadow with some teaks to make things look better with WinUI 2.6 styles. (at least some 2px -> 4px corner radius updates) |
@michael-hawker No, not ready to go. Need to fix the samples. I still plan on getting to that this week. |
This is now the same as ColorPicker samples
This PR has been marked as "needs attention 👋" and awaiting a response from the team. |
This should be all set now |
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.
Looks good!
Hello @michael-hawker! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Thanks @robloo for continued improvements to the Color Picker! |
👉 It is imperative to resolve ONE ISSUE PER PR and avoid making multiple changes unless the changes interrelate with each otherFixes #4121
Relates to #3643
DefaultForeground
property Brush values in the XAML default style instead of when registering the DP. This is necessary to ensure a reference isn't shared across instances or threads. [From discord discussion]PR Type
What kind of change does this PR introduce?
What is the current behavior?
What is the new behavior?
PR Checklist
Please check if your PR fulfills the following requirements:
Other information