Skip to content

Commit

Permalink
Make SearcherItems selectable
Browse files Browse the repository at this point in the history
On MacOS, this prevents the categories from being highlighted
  • Loading branch information
gselzer committed Aug 17, 2023
1 parent 998e5ad commit f91b7e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/napari_imagej/widgets/result_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(

# Set QtPy properties
self.setEditable(False)
self.setFlags((self.flags() & ~Qt.ItemIsSelectable) | Qt.ItemIsUserCheckable)
self.setFlags(self.flags() | Qt.ItemIsUserCheckable)
checked = ij().get("org.scijava.search.SearchService").enabled(searcher)
self.setCheckState(Qt.Checked if checked else Qt.Unchecked)

Expand Down
1 change: 1 addition & 0 deletions tests/widgets/test_result_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def test_searcherTreeItem_regression():
assert (
item.flags()
== Qt.ItemIsUserCheckable
| Qt.ItemIsSelectable
| Qt.ItemIsEnabled
| Qt.ItemIsDragEnabled
| Qt.ItemIsDropEnabled
Expand Down

0 comments on commit f91b7e0

Please sign in to comment.