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

Labels layer: add keybinding to set the label to 0 #5666

Closed
psobolewskiPhD opened this issue Mar 25, 2023 · 1 comment · Fixed by #5672
Closed

Labels layer: add keybinding to set the label to 0 #5666

psobolewskiPhD opened this issue Mar 25, 2023 · 1 comment · Fixed by #5672
Labels
task Tasks for contributors and maintainers ui change UI/UX

Comments

@psobolewskiPhD
Copy link
Member

🧰 Task

There is the ability to set a new label, bound by default to m, but there isn't an easy way to set the label to 0 such that the fill tool can use used to erase in bulk, so to speak.
There should be an easy keybind for this that should be editable by the user. Perhaps n because it's close to m and the spacebar?

@jni
Copy link
Member

jni commented Mar 27, 2023

Well one question is why is it "m" — oh right for max. Anyway, I think n could be confusing because new. Should we set to 9 (new/max) and 0? This somewhat corresponds to the labeling modes shortcuts...

brisvag pushed a commit that referenced this issue Apr 5, 2023
…ng) (#5672)

# Description

This adds an action analogous to the current `new_label` action (current
keybind `M`) to set the current label to background (0). The default
keybind has been set to `B` because it's close to space and close M,
plus B for `background`. Open to other suggestions.
This is sort of similar to `activate_labels_erase_mode` but in a lot of
ways more powerful, because you can use the `fill` tool to erase
contiguous areas.

## Type of change
<!-- Please delete options that are not relevant. -->
- [ ] 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 #5666
First came up in a docs PR:
napari/docs#125 (comment)

# How has this been tested?
<!-- Please describe the tests that you ran to verify your changes. -->
- [x] example: I added a test
- [x] example: all tests pass with my change
- [ ] example: I check if my changes works with both PySide and PyQt
backends
      as there are small differences between the two Qt bindings.  

## 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: will
update napari/docs#125 once the default keybind
is settled.
- [ ] 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).
kcpevey pushed a commit to kcpevey/napari that referenced this issue Apr 6, 2023
…ng) (napari#5672)

# Description

This adds an action analogous to the current `new_label` action (current
keybind `M`) to set the current label to background (0). The default
keybind has been set to `B` because it's close to space and close M,
plus B for `background`. Open to other suggestions.
This is sort of similar to `activate_labels_erase_mode` but in a lot of
ways more powerful, because you can use the `fill` tool to erase
contiguous areas.

## Type of change
<!-- Please delete options that are not relevant. -->
- [ ] 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#5666
First came up in a docs PR:
napari/docs#125 (comment)

# How has this been tested?
<!-- Please describe the tests that you ran to verify your changes. -->
- [x] example: I added a test
- [x] example: all tests pass with my change
- [ ] example: I check if my changes works with both PySide and PyQt
backends
      as there are small differences between the two Qt bindings.  

## 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: will
update napari/docs#125 once the default keybind
is settled.
- [ ] 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
task Tasks for contributors and maintainers ui change UI/UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants