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

Bugfix: force a redraw to ensure highlight shows when Points are select-all selected #5771

Merged

Conversation

psobolewskiPhD
Copy link
Member

Fixes/Closes

Bug discussed here: #5748 (comment)

Description

If you are using the + tool or select tool and use the select-all keybind, then the points are not visually selected.
If you use the + tool and use select-all then toggle to the selection tool, then they will be visually selected.
If you use the select tool, then they never appear to get visually selected.

This is because the keybind calls layer._set_highlight() but doesn't force a redraw using force=True.
This PR uses layer._set_highlight(force=True) to ensure that a redraw happens, so the visual selection occurs.

References

Discussion starts here:
#5748 (comment)

Type of change

  • Bug-fix (non-breaking change which fixes an issue)

How has this been tested?

  • example: the test suite for my feature covers cases x, y, and z
  • 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:

  • My PR is the minimum possible work for the desired functionality

@codecov
Copy link

codecov bot commented Apr 25, 2023

Codecov Report

Merging #5771 (6affd73) into main (ede0563) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #5771      +/-   ##
==========================================
+ Coverage   89.85%   89.87%   +0.01%     
==========================================
  Files         609      610       +1     
  Lines       52055    52121      +66     
==========================================
+ Hits        46775    46842      +67     
+ Misses       5280     5279       -1     
Impacted Files Coverage Δ
napari/layers/points/_points_key_bindings.py 100.00% <100.00%> (ø)

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

Copy link
Contributor

@brisvag brisvag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems straight forward!

@alisterburt alisterburt added this to the 0.4.18 milestone Apr 29, 2023
@alisterburt alisterburt merged commit af59c75 into napari:main Apr 29, 2023
@Czaki Czaki mentioned this pull request Jun 7, 2023
Czaki pushed a commit that referenced this pull request Jun 19, 2023
…ct-all selected (#5771)

# Fixes/Closes

Bug discussed here:
#5748 (comment)

# Description

If you are using the + tool or select tool and use the select-all
keybind, then the points are not visually selected.
If you use the + tool and use select-all then toggle to the selection
tool, then they will be visually selected.
If you use the select tool, then they never appear to get visually
selected.

This is because the keybind calls `layer._set_highlight()` but doesn't
force a redraw using `force=True`.
This PR uses `layer._set_highlight(force=True)` to ensure that a redraw
happens, so the visual selection occurs.


# References
Discussion starts here:
#5748 (comment)

## Type of change
<!-- Please delete options that are not relevant. -->
- [x] Bug-fix (non-breaking change which fixes an issue)

# How has this been tested?
<!-- Please describe the tests that you ran to verify your changes. -->
- [ ] example: the test suite for my feature covers cases x, y, and z
- [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
Czaki pushed a commit that referenced this pull request Jun 21, 2023
…ct-all selected (#5771)

# Fixes/Closes

Bug discussed here:
#5748 (comment)

# Description

If you are using the + tool or select tool and use the select-all
keybind, then the points are not visually selected.
If you use the + tool and use select-all then toggle to the selection
tool, then they will be visually selected.
If you use the select tool, then they never appear to get visually
selected.

This is because the keybind calls `layer._set_highlight()` but doesn't
force a redraw using `force=True`.
This PR uses `layer._set_highlight(force=True)` to ensure that a redraw
happens, so the visual selection occurs.


# References
Discussion starts here:
#5748 (comment)

## Type of change
<!-- Please delete options that are not relevant. -->
- [x] Bug-fix (non-breaking change which fixes an issue)

# How has this been tested?
<!-- Please describe the tests that you ran to verify your changes. -->
- [ ] example: the test suite for my feature covers cases x, y, and z
- [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
Czaki pushed a commit that referenced this pull request Jun 21, 2023
…ct-all selected (#5771)

# Fixes/Closes

Bug discussed here:
#5748 (comment)

# Description

If you are using the + tool or select tool and use the select-all
keybind, then the points are not visually selected.
If you use the + tool and use select-all then toggle to the selection
tool, then they will be visually selected.
If you use the select tool, then they never appear to get visually
selected.

This is because the keybind calls `layer._set_highlight()` but doesn't
force a redraw using `force=True`.
This PR uses `layer._set_highlight(force=True)` to ensure that a redraw
happens, so the visual selection occurs.


# References
Discussion starts here:
#5748 (comment)

## Type of change
<!-- Please delete options that are not relevant. -->
- [x] Bug-fix (non-breaking change which fixes an issue)

# How has this been tested?
<!-- Please describe the tests that you ran to verify your changes. -->
- [ ] example: the test suite for my feature covers cases x, y, and z
- [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
Czaki pushed a commit that referenced this pull request Jun 21, 2023
…ct-all selected (#5771)

# Fixes/Closes

Bug discussed here:
#5748 (comment)

# Description

If you are using the + tool or select tool and use the select-all
keybind, then the points are not visually selected.
If you use the + tool and use select-all then toggle to the selection
tool, then they will be visually selected.
If you use the select tool, then they never appear to get visually
selected.

This is because the keybind calls `layer._set_highlight()` but doesn't
force a redraw using `force=True`.
This PR uses `layer._set_highlight(force=True)` to ensure that a redraw
happens, so the visual selection occurs.


# References
Discussion starts here:
#5748 (comment)

## Type of change
<!-- Please delete options that are not relevant. -->
- [x] Bug-fix (non-breaking change which fixes an issue)

# How has this been tested?
<!-- Please describe the tests that you ran to verify your changes. -->
- [ ] example: the test suite for my feature covers cases x, y, and z
- [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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR with bugfix UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants