-
Notifications
You must be signed in to change notification settings - Fork 50
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
optional params as checkbox with widget #645
Comments
Hi @tlambert03 , In this example, I had to define a custom |
Linking code here for reference: |
thank you both. @hanjinliu it would be great if you wanted to adapt your solution and contribute it here.. I think in terms of the GUI: what I'd want is probably something that looks like @cmalinmayor's widget: just a new checkbox on the left of the widget, without any text. When checked, the linked widget is enabled, and when unchecked, the linked widget is disabled and the default value is used. (the checkbox could have a tooltip that shows the literal default value that would be used when unchecked)
I think the semantics I would go for is:
I just don't think we should worry about a case where the user wants the checkbox to mean "go back to the default value". Since the end-user can always use the main widget to return the value to the default value, that is where it should be done (not using a checkbox). I can imagine a separate feature that would allow something like a right-click on the widget to return to the default value, but i think checkbox should gate "None-ness" not an implicit setting of the value to a non-null default value. |
Yes, it is how I implemented (I realized now that the sentence "Use default value" was not appropriate). In terms of the design, do you think the checkbox should be on the left side? It seems not consistent with other labeled widgets. It also makes the behavior of |
@cmalinmayor does this for parameters that have
Optional[thing]
:i like it, and we could do something similar here
The text was updated successfully, but these errors were encountered: