Skip to content

Commit

Permalink
Adding processing for saving a project
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneGit committed Apr 26, 2024
1 parent f815ffb commit d88c44f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,15 +684,19 @@ def change_layer_view(

def eventFilter(self, obj, event):
if event.type() == QEvent.KeyPress:
self.cancel_movement_event(event)
self.keyPressProcessing(event)
return True
return super().eventFilter(obj, event)

def keyPressEvent(self, event):
if not self.cancel_movement_event(event):
if not self.keyPressProcessing(event):
super().keyPressEvent(event)

def cancel_movement_event(self, event):
def keyPressProcessing(self, event):
if event.modifiers() == Qt.ControlModifier and event.key() == Qt.Key_S:
self.save_project_signal.emit()
return True

if self.move_button.isChecked():
if event.modifiers() == Qt.ControlModifier and event.key() == Qt.Key_Z:
self.cancel_movement()
Expand Down

0 comments on commit d88c44f

Please sign in to comment.