Skip to content

Commit

Permalink
set movable to false and overrode hoverEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
RukiyyeE committed Aug 6, 2024
1 parent 46a8cd2 commit df20e16
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cellpose/gui/guiparts.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ def __init__(self, parent=None):

# Create and add a highlight rectangle to the minimap with initial position [0, 0] and size [100, 100], outlined
# in white with a 3-pixel width.
self.highlight_area = pg.RectROI([0, 0], [100, 100], pen=pg.mkPen('w', width=3), resizable=False)
self.highlight_area = pg.RectROI([0, 0], [100, 100], pen=pg.mkPen('w', width=3), resizable=False, movable=False)
self.highlight_area.hoverEvent = lambda event: None
# Remove all resize handles after initialization
QtCore.QTimer.singleShot(0, lambda: [self.highlight_area.removeHandle(handle) for handle in
self.highlight_area.getHandles()])
Expand Down Expand Up @@ -636,6 +637,7 @@ def mousePressEvent(self, event):
# Change the view in the main window to the clicked position
self.parent().center_view_on_position(normalized_x, normalized_y)


class ViewBoxNoRightDrag(pg.ViewBox):

def __init__(self, parent=None, border=None, lockAspect=False, enableMouse=True,
Expand Down

0 comments on commit df20e16

Please sign in to comment.