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

Update status bar on active layer change #5754

Merged
merged 1 commit into from Apr 22, 2023
Merged

Update status bar on active layer change #5754

merged 1 commit into from Apr 22, 2023

Conversation

jnahlers
Copy link
Contributor

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 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.

References

Type of change

  • 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

How has this been tested?

I have not tested.

Final checklist:

  • 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.

@codecov
Copy link

codecov bot commented Apr 21, 2023

Codecov Report

Merging #5754 (b835cd2) into main (95356e4) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            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     
Impacted Files Coverage Δ
napari/components/viewer_model.py 96.01% <100.00%> (+<0.01%) ⬆️

... 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.

@Czaki Czaki added the bugfix PR with bugfix label Apr 21, 2023
@Czaki Czaki added this to the 0.4.18 milestone Apr 21, 2023
@Czaki Czaki added the ready to merge Last chance for comments! Will be merged in ~24h label Apr 21, 2023
Copy link
Contributor

@alisterburt alisterburt left a 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 🚀

@alisterburt alisterburt merged commit 7b6bb06 into napari:main Apr 22, 2023
37 of 38 checks passed
@psobolewskiPhD psobolewskiPhD removed the ready to merge Last chance for comments! Will be merged in ~24h label Apr 30, 2023
@jnahlers jnahlers deleted the fix/status-on-layer-select branch May 7, 2023 06:41
@Czaki Czaki mentioned this pull request Jun 7, 2023
Czaki pushed a commit that referenced this pull request Jun 19, 2023
<!-- 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).
Czaki pushed a commit that referenced this pull request Jun 21, 2023
<!-- 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).
Czaki pushed a commit that referenced this pull request Jun 21, 2023
<!-- 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).
Czaki pushed a commit that referenced this pull request Jun 21, 2023
<!-- 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR with bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Status bar doesn't update when layer selection changes
4 participants