choose color dialog
This issue is for tracking any decisions before implementing this widget.
Windows how-to: https://docs.microsoft.com/en-us/windows/win32/dlgbox/color-dialog-box
After a bit of thinking, such feature should not be a widget but a reusable callback (std::function perhaps) that can be attached to event handlers.
Few things need to be decided upon:
- where to put all such callbacks in elements
- how to implement their behavior (should be trivial if all such modals on all platforms are blocking)
- how to unify the interface of all platforms so that elements API is platform-independent
Makes sense! I think we can probably put that in support. I do not have answers now, but I am pretty sure it will become evident once we implement it. I think it can simply be a free function. Cross platform might be interesting :-)
Got any links/references for relevant functions on different systems? I have no knowledge of Mac OS and not sure if Linux has the same interface on all distributions.
IDK about the callback idea, I see 2 basic options: native (as late reply to the above comment):
- Cocoa: NSColorPanel
- GTK: GTKColorChooserDialog (the link points to GTKColorChooserWidget, which has a better description, mentioning the Dialog)
- win32: ChooseColor function (from the OP)
or an elements specific widget.
I like more the native option (that might be implemented in a small external library), though the only dialog that I see useful for a plugin UI framework would be a filedialog (in which case I also prefer native, especially on Linux that can use Freedesktop portal).
Or just use this: https://sourceforge.net/projects/tinyfiledialogs/