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

ColourPicker does not differentiate cancelling and selecting a color #202

Open
regorxxx opened this issue Feb 17, 2023 · 0 comments
Open

Comments

@regorxxx
Copy link

https://theqwertiest.github.io/foo_spider_monkey_panel/assets/generated_files/docs/html/js_foo_spider_monkey_panel.js.html#line1495

Contrary to the InputBox method, cancelling always return a color. That limits the popup handling since there is no way to differentiate between these 2 cases:

  • User canceled the popup because they didn't want any color (i.e. no change). Default color is applied.
  • User selected the default color on purpose.

InputBox has an error on cancel option, which allows to differentiate those situations. Current design assumes a color is always used, which may be not true in all cases. Due to this design, most scripts I have seen have to expose 2 settings for the final user: (making it more complex than needed).

  1. One to set a custom color (for ex. a background).
  2. Another to use the custom color set.

This is because as soon as a user calls the 1st menu, a color is always set...

Suggestion:
ColourPicker(window_id, default_colour, error_on_cancelopt)

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

1 participant