Skip to content

Commit

Permalink
Fixed bug: Minimap updates if picture is updated using the file menu
Browse files Browse the repository at this point in the history
  • Loading branch information
mariehartung committed Jul 8, 2024
1 parent c87efd3 commit 7cfaa66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cellpose/gui/guiparts.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ def __init__(self, parent=None):
# Add the viewbox to the image widget
self.image_widget.addItem(self.viewbox)

# This marks the menu button as checked
parent.minimapWindow.setChecked(True)

def closeEvent(self, event: QEvent):
"""
Method to uncheck the button in the menu if the window is closed.
Expand Down
3 changes: 1 addition & 2 deletions cellpose/gui/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,10 @@ def _load_image(parent, filename=None, load_seg=True, load_3D=False):
parent.minimapWindow.setChecked(False)
# Create a new instance before calling update_image
parent.minimap_window_instance = guiparts.MinimapWindow(parent)
parent.minimap_window_instance.show()
else:
parent.minimap_window_instance = guiparts.MinimapWindow(parent)
parent.minimap_window_instance.show()
# We want to mark the "minimap" menu button as checked if an image is loaded
parent.minimapWindow.setChecked(True)


def _initialize_images(parent, image, load_3D=False):
Expand Down

0 comments on commit 7cfaa66

Please sign in to comment.