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
Update status bar on active layer change #5754
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5754 +/- ##
==========================================
+ Coverage 89.83% 89.85% +0.01%
==========================================
Files 608 608
Lines 51881 51882 +1
==========================================
+ Hits 46608 46618 +10
+ Misses 5273 5264 -9
... and 4 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. |
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.
Welcome @jnahlers ! Awesome first PR, thank you for taking the time to contribute and congratulations 🚀
<!-- In general, PRs should fix an existing issue on the repo. --> <!-- Please link to that issue here as "Closes #(issue-number)". --> Closes #5749 <!-- What does this pull request (PR) do? Why is it necessary? --> <!-- Tell us about your new feature, improvement, or fix! --> <!-- If your change includes user interface changes, please add an image, or an animation "An image is worth a thousand words!" --> <!-- You can use https://www.cockos.com/licecap/ or similar to create animations --> Updates the status bar when updating the viewer's state on a new active layer being selected. I just decided to call `ViewerModel`'s `_update_status_bar_from_cursor` at the end of `_on_active_layer`, instead of adding a new connection from `self.layers.selection.events.active` to `_update_status_bar_from_cursor`, as I thought it cleaner to have one connection and put all viewer state update code in `_on_active_layer`. <!-- What resources, documentation, and guides were used in the creation of this PR? --> <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) - [ ] 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 I have not tested. - [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).
<!-- In general, PRs should fix an existing issue on the repo. --> <!-- Please link to that issue here as "Closes #(issue-number)". --> Closes #5749 <!-- What does this pull request (PR) do? Why is it necessary? --> <!-- Tell us about your new feature, improvement, or fix! --> <!-- If your change includes user interface changes, please add an image, or an animation "An image is worth a thousand words!" --> <!-- You can use https://www.cockos.com/licecap/ or similar to create animations --> Updates the status bar when updating the viewer's state on a new active layer being selected. I just decided to call `ViewerModel`'s `_update_status_bar_from_cursor` at the end of `_on_active_layer`, instead of adding a new connection from `self.layers.selection.events.active` to `_update_status_bar_from_cursor`, as I thought it cleaner to have one connection and put all viewer state update code in `_on_active_layer`. <!-- What resources, documentation, and guides were used in the creation of this PR? --> <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) - [ ] 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 I have not tested. - [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).
<!-- In general, PRs should fix an existing issue on the repo. --> <!-- Please link to that issue here as "Closes #(issue-number)". --> Closes #5749 <!-- What does this pull request (PR) do? Why is it necessary? --> <!-- Tell us about your new feature, improvement, or fix! --> <!-- If your change includes user interface changes, please add an image, or an animation "An image is worth a thousand words!" --> <!-- You can use https://www.cockos.com/licecap/ or similar to create animations --> Updates the status bar when updating the viewer's state on a new active layer being selected. I just decided to call `ViewerModel`'s `_update_status_bar_from_cursor` at the end of `_on_active_layer`, instead of adding a new connection from `self.layers.selection.events.active` to `_update_status_bar_from_cursor`, as I thought it cleaner to have one connection and put all viewer state update code in `_on_active_layer`. <!-- What resources, documentation, and guides were used in the creation of this PR? --> <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) - [ ] 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 I have not tested. - [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).
<!-- In general, PRs should fix an existing issue on the repo. --> <!-- Please link to that issue here as "Closes #(issue-number)". --> Closes #5749 <!-- What does this pull request (PR) do? Why is it necessary? --> <!-- Tell us about your new feature, improvement, or fix! --> <!-- If your change includes user interface changes, please add an image, or an animation "An image is worth a thousand words!" --> <!-- You can use https://www.cockos.com/licecap/ or similar to create animations --> Updates the status bar when updating the viewer's state on a new active layer being selected. I just decided to call `ViewerModel`'s `_update_status_bar_from_cursor` at the end of `_on_active_layer`, instead of adding a new connection from `self.layers.selection.events.active` to `_update_status_bar_from_cursor`, as I thought it cleaner to have one connection and put all viewer state update code in `_on_active_layer`. <!-- What resources, documentation, and guides were used in the creation of this PR? --> <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) - [ ] 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 I have not tested. - [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).
Fixes/Closes
Closes #5749
Description
Updates the status bar when updating the viewer's state on a new active layer being selected. I just decided to call
ViewerModel
's_update_status_bar_from_cursor
at the end of_on_active_layer
, instead of adding a new connection fromself.layers.selection.events.active
to_update_status_bar_from_cursor
, as I thought it cleaner to have one connection and put all viewer state update code in_on_active_layer
.References
Type of change
How has this been tested?
I have not tested.
Final checklist:
trans.
to make them localizable.For more information see our translations guide.