Skip to content

Commit

Permalink
Update README and enhance annotation deletion functionality
Browse files Browse the repository at this point in the history
- Removed downloads badge from README
- Updated key event handling to allow deletion of selected annotations using both Backspace and Delete keys
- Commented out toolbar action for slicer tool in main window
  • Loading branch information
Jordan-Pierce committed Dec 16, 2024
1 parent 899702e commit e82c310
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
[![windows](https://github.com/Jordan-Pierce/CoralNet-Toolbox/actions/workflows/windows.yml/badge.svg)](https://pypi.org/project/CoralNet-Toolbox)
[![macos](https://github.com/Jordan-Pierce/CoralNet-Toolbox/actions/workflows/macos.yml/badge.svg)](https://pypi.org/project/CoralNet-Toolbox)
[![ubuntu](https://github.com/Jordan-Pierce/CoralNet-Toolbox/actions/workflows/ubuntu.yml/badge.svg)](https://pypi.org/project/CoralNet-Toolbox)
[![downloads](https://static.pepy.tech/badge/coralnet-toolbox)](https://pepy.tech/projects/coralnet-toolbox)

</div>


Expand Down
9 changes: 5 additions & 4 deletions coralnet_toolbox/QtAnnotationWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,11 @@ def keyPressEvent(self, event):
self.tools[self.selected_tool].keyPressEvent(event)
super().keyPressEvent(event)

# Handle the hot key for deleting
if event.modifiers() & Qt.ControlModifier and event.key() == Qt.Key_Delete:
if self.selected_annotations:
self.delete_selected_annotation()
# Handle the hot key for deleting (backspace or delete) selected annotations
if event.modifiers() & Qt.ControlModifier:
if event.key() == Qt.Key_Delete or event.key() == Qt.Key_Backspace:
if self.selected_annotations:
self.delete_selected_annotation()

def keyReleaseEvent(self, event):
if self.active_image and self.selected_tool:
Expand Down
2 changes: 1 addition & 1 deletion coralnet_toolbox/QtMainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def __init__(self):
self.slicer_tool_action = QAction(self.slicer_icon, "Slicer", self)
self.slicer_tool_action.setCheckable(False)
self.slicer_tool_action.triggered.connect(self.toggle_tool)
self.toolbar.addAction(self.slicer_tool_action)
# self.toolbar.addAction(self.slicer_tool_action) TODO

self.toolbar.addSeparator()

Expand Down

0 comments on commit e82c310

Please sign in to comment.