-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Adding ColorPicker and Related Primitive Controls #4179
Comments
I am trying to implement ColorPicker from WinUI in Avalonia. By the way, I like how your ColorPicker looks! |
Awesome, I'm glad someone is already working on this! The main issues with the WinUI/UWP ColorPicker I find are poor styling/layout, large size that isn't adaptive, and it doesn't fit in with other pickers (no flyout). Since AvaloniaUI is fixing past mistakes whenever possible it might make sense to correct those here. Alternatively, we could go with a two control approach which is what I'm advocating for in UWP:
|
@grokys @danwalmsley Regardless of if this 'ColorSwatchPicker' gets into the windows community toolkit or WinUI would you consider it for this project? If so, I would be happy to provide a port as I'm already doing for the UWP repos. As stated above, I propose two controls: (1) the ColorPicker similar to UWP that @maxkatz6 is already working on and (2) This flyout-style ColorSwatchPicker useful for constrained spaces or where form-style input is needed. |
I got the go ahead to start adding the flyout-style ColorPickerButton to the UWP toolkit. I still think it would be very useful in Avalonia so would like some additional feedback on this issue. It also became apparent that the UWP ColorPicker is incorrectly named. It is not a Picker like the other controls: DatePicker, TimePicker, etc. It would be better to correct this in Avalonia now and follow the WPF extended toolkit convention: https://www.codeproject.com/Articles/779105/Color-Canvas-and-Color-Picker-WPF-Toolkit
|
@robloo I have pushed my ColorPicker port from WinUI - https://github.com/maxkatz6/AvaloniaWinUI.ColorPicker Another WinUI port can be found here https://github.com/amwx/FluentAvalonia |
@maxkatz6 Good stuff! I'm starting my own port to the Uno Platform from the WinUI sources as well. I'm not going to use yours as a base so I don't have to worry about the Avalonia-specific changes and also so I can document the architecture in WinUI. That said, it will be good to do a diff of the two C# versions once complete too see if there are any mistakes. |
@maxkatz6 The Uno Platform C# port of this was completed as well. I'll circle back to the ColorPickerButton in the Windows Community Toolkit by next week and hopefully bring that to completion. The Toolkit maintainer wants to completely re-style the ColorPicker itself to get some of these updates. However, we can ignore those for now and just bring in the Button in a month or two when its ready. It should be a lot easier as it's already C# and only depends on the ColorSpectrum. |
@maxkatz6 Would be great to get this in for the next 0.11 release. I'll port over the ColorPickerButton once you have merged in at least the ColorSpectrum. There can likely then be some larger architectural changes to modernize things and make the control responsive (something the WinUI version lacks). |
Would be nice to integrate that into the DevTools as well to allow for easier styling etc. |
With Flyout almost added that unblocks DropDownButton which I plan to have implemented along with the other remaining WinUI button types. With DropDownButton I think this ColorPicker concept itself becomes unblocked. I still have not figured out exactly what the implementation will look like. I go back and forth between doing a clean reimplementation fixing all the wrongs with WinUI or just porting over directly from the WCT and using @maxkatz6 port as-is. The WPF toolkit had better names for these controls though (WinUI's ColorPicker is really a ColorCanvas and the ColorPickerButton is really what the ColorPicker should be). There are other architectural/naming changes I would like to make based on this document and discussed a little with @maxkatz6 here. This would align the control quite a bit more with XAML concepts. What I want to get a feel for is how people would accept larger deviations from WinUI such as the control names themselves and the property name updates (ThirdDimension -> ThirdChannel) etc. Any comments? I would also encourage everyone to try out the Windows Community Toolkit 7.0 or later to get an understanding of the ColorPicker changes I'm talking about |
Here is the plan:
Each of these components will be implemented in a separate PR so there is a chance it can be reviewed sanely:
There is an open question of naming. The WinUI code isn't even consistent here.
|
@robloo may I ask, do you plan to port SwitchPresenter as well or use styled TabControl? TabStrip? From what I see, we don't really need a new control here. |
No, I don't plan to port SwitchPresenter. I have the same conclusion that TabControl/TabStrip is enough. |
Adding ColorPicker/Button and ColorCanvas Controls
I don't think Avalonia has a ColorPicker control. Is there a plan to add this to the project? If so, I've been implementing my own (as many others have) and would like to propose the below idea. This is currently for UWP but porting should be possible. Right now I think it provides a unique concept to discuss and see if it fits with this project.
ColorCanvas
See WinUI
ColorPicker Example
Newest example:
Older example from the Windows Community Toolkit
The text was updated successfully, but these errors were encountered: