mirror of
https://github.com/fergalmoran/picard.git
synced 2025-12-28 12:17:37 +00:00
Use standard key sequences instead of custom checks in keyPressEvent.
Ensures platform specific shortcuts are used.
This commit is contained in:
@@ -22,11 +22,11 @@ import uuid
|
||||
|
||||
from PyQt5 import (
|
||||
QtCore,
|
||||
QtGui,
|
||||
QtWidgets,
|
||||
)
|
||||
|
||||
from picard import config
|
||||
from picard.const.sys import IS_MACOS
|
||||
from picard.util import restore_method
|
||||
|
||||
|
||||
@@ -88,8 +88,7 @@ class PicardDialog(QtWidgets.QDialog, PreserveGeometry):
|
||||
super().__init__(parent, self.flags)
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
if (IS_MACOS and event.modifiers() & QtCore.Qt.ControlModifier
|
||||
and event.key() == QtCore.Qt.Key_W):
|
||||
if event.matches(QtGui.QKeySequence.Close):
|
||||
self.close()
|
||||
else:
|
||||
super().keyPressEvent(event)
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
from PyQt5 import (
|
||||
QtCore,
|
||||
QtGui,
|
||||
QtWidgets,
|
||||
)
|
||||
|
||||
@@ -30,8 +31,7 @@ class EditableListView(QtWidgets.QListView):
|
||||
self.setDragDropMode(QtWidgets.QAbstractItemView.InternalMove)
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
if (event.modifiers() == QtCore.Qt.NoModifier
|
||||
and event.key() == QtCore.Qt.Key_Delete):
|
||||
if event.matches(QtGui.QKeySequence.Delete):
|
||||
self.remove_selected_rows()
|
||||
else:
|
||||
super().keyPressEvent(event)
|
||||
|
||||
Reference in New Issue
Block a user