-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Bugfix: ensure pan/zoom buttons work, along with spacebar keybinding #5669
Bugfix: ensure pan/zoom buttons work, along with spacebar keybinding #5669
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5669 +/- ##
=======================================
Coverage 89.85% 89.86%
=======================================
Files 611 609 -2
Lines 51669 51673 +4
=======================================
+ Hits 46428 46434 +6
+ Misses 5241 5239 -2
... and 3 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Could we move pan/zoom from layers to viewer with action like:
This is dummy code written form memory and may not work. Such action will allow having one global shortcut for all layers. |
Ok, I moved it over to napari/components/_viewer_key_bindings.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! Configurability doesn't really hurt here I think :)
Until we do not have a mechanism to prevent overwrite in setting built-in shortcuts, then making it configurable is better. |
…apari#5669) # Description This fixes issues with Pan/Zoom buttons (layer controls) not working and the spacebar keybinding to activate pan/zoom mode also not working. In napari#4894 there was some refactoring which introduced the bugs, see my investigation here: napari#5654 This PR fixes the typo, lack of proper layer types, and now moves the `hold_for_pan_zoom` to be a Viewer keybinding. As a result, this keybinding isn't hard-coded anymore, but is now settable in the Preferences > Shortcuts. ## Type of change <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update # References closes napari#5654 # How has this been tested? Good question! All tests were passing before this PR, despite the fact that things were broken. So I'm open to suggestions how to improve tests so we catch stuff better. ## Final checklist: - [x] My PR is the minimum possible work for the desired functionality - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] If I included new strings, I have used `trans.` to make them localizable. For more information see our [translations guide](https://napari.org/developers/translations.html).
…5669) This fixes issues with Pan/Zoom buttons (layer controls) not working and the spacebar keybinding to activate pan/zoom mode also not working. In #4894 there was some refactoring which introduced the bugs, see my investigation here: #5654 This PR fixes the typo, lack of proper layer types, and now moves the `hold_for_pan_zoom` to be a Viewer keybinding. As a result, this keybinding isn't hard-coded anymore, but is now settable in the Preferences > Shortcuts. <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update closes #5654 Good question! All tests were passing before this PR, despite the fact that things were broken. So I'm open to suggestions how to improve tests so we catch stuff better. - [x] My PR is the minimum possible work for the desired functionality - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] If I included new strings, I have used `trans.` to make them localizable. For more information see our [translations guide](https://napari.org/developers/translations.html).
…5669) This fixes issues with Pan/Zoom buttons (layer controls) not working and the spacebar keybinding to activate pan/zoom mode also not working. In #4894 there was some refactoring which introduced the bugs, see my investigation here: #5654 This PR fixes the typo, lack of proper layer types, and now moves the `hold_for_pan_zoom` to be a Viewer keybinding. As a result, this keybinding isn't hard-coded anymore, but is now settable in the Preferences > Shortcuts. <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update closes #5654 Good question! All tests were passing before this PR, despite the fact that things were broken. So I'm open to suggestions how to improve tests so we catch stuff better. - [x] My PR is the minimum possible work for the desired functionality - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] If I included new strings, I have used `trans.` to make them localizable. For more information see our [translations guide](https://napari.org/developers/translations.html).
…5669) This fixes issues with Pan/Zoom buttons (layer controls) not working and the spacebar keybinding to activate pan/zoom mode also not working. In #4894 there was some refactoring which introduced the bugs, see my investigation here: #5654 This PR fixes the typo, lack of proper layer types, and now moves the `hold_for_pan_zoom` to be a Viewer keybinding. As a result, this keybinding isn't hard-coded anymore, but is now settable in the Preferences > Shortcuts. <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update closes #5654 Good question! All tests were passing before this PR, despite the fact that things were broken. So I'm open to suggestions how to improve tests so we catch stuff better. - [x] My PR is the minimum possible work for the desired functionality - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] If I included new strings, I have used `trans.` to make them localizable. For more information see our [translations guide](https://napari.org/developers/translations.html).
…5669) This fixes issues with Pan/Zoom buttons (layer controls) not working and the spacebar keybinding to activate pan/zoom mode also not working. In #4894 there was some refactoring which introduced the bugs, see my investigation here: #5654 This PR fixes the typo, lack of proper layer types, and now moves the `hold_for_pan_zoom` to be a Viewer keybinding. As a result, this keybinding isn't hard-coded anymore, but is now settable in the Preferences > Shortcuts. <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update closes #5654 Good question! All tests were passing before this PR, despite the fact that things were broken. So I'm open to suggestions how to improve tests so we catch stuff better. - [x] My PR is the minimum possible work for the desired functionality - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] If I included new strings, I have used `trans.` to make them localizable. For more information see our [translations guide](https://napari.org/developers/translations.html).
Description
This fixes issues with Pan/Zoom buttons (layer controls) not working and the spacebar keybinding to activate pan/zoom mode also not working.
In #4894 there was some refactoring which introduced the bugs, see my investigation here: #5654
This PR fixes the typo, lack of proper layer types, and now moves the
hold_for_pan_zoom
to be a Viewer keybinding. As a result, this keybinding isn't hard-coded anymore, but is now settable in the Preferences > Shortcuts.Type of change
References
closes #5654
How has this been tested?
Good question! All tests were passing before this PR, despite the fact that things were broken. So I'm open to suggestions how to improve tests so we catch stuff better.
Final checklist:
trans.
to make them localizable.For more information see our translations guide.