-
Notifications
You must be signed in to change notification settings - Fork 295
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
Support default keys for makeToolButton #347
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
To summarize the discussion I had with @sdorkenw last week:
This pull request seems to be intended to address point 2 alone. Does the seung lab believe that will be sufficient to address this issue, or is it desired that additional changes also be made? |
As far as the implementation, although I can see that makeToolBinding provides a convenient place to add the logic, it is not really the right place, since that will only be called when the UI control is created, i.e. when the side panel is shown. Instead, the assignment of a default key binding should occur when the layer is created, or when the graph source is first added, I think. But that is indeed a bit tricky. Also we do really need to solve the issue of being able to unbind the key and not have it come right back. |
This is part of the seung-lab merge project (see #340).
It would be convenient to have default keybinds for operations like merge and split, so that the user doesn't have to set them manually. This PR adds an optional
defaultKey
parameter to theToolBindingWidget
constructor andmakeToolButton
function, which will fill in the tool button with that key the first time Neuroglancer is loaded, but respect the user's choice and use a different key if one has been set manually.Caveat: If the user unsets the tool (by double-clicking) then reloads Neuroglancer, it will be set back to the default. The
LayerToolBinder.jsonToKey
isn't structured to support tool ->undefined
mappings, so I'm not sure if there's a good way around this, but it's a minor annoyance.