mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
remove old Mac shortcut code completely
The shortcuts seem to work correctly without it on Qt 5.14, so this code seems to have only been required for older Qt releases.
This commit is contained in:
parent
5989fb8ef6
commit
a54f181ae0
2 changed files with 1 additions and 20 deletions
|
@ -1052,7 +1052,7 @@ $editorToolbar.then(({{ toolbar }}) => toolbar.appendGroup({{
|
|||
|
||||
class EditorWebView(AnkiWebView):
|
||||
def __init__(self, parent: QWidget, editor: Editor) -> None:
|
||||
AnkiWebView.__init__(self, title="editor", mac_default_shortcuts=False)
|
||||
AnkiWebView.__init__(self, title="editor")
|
||||
self.editor = editor
|
||||
self.setAcceptDrops(True)
|
||||
self._markInternal = False
|
||||
|
|
|
@ -213,8 +213,6 @@ class AnkiWebView(QWebEngineView):
|
|||
self,
|
||||
parent: Optional[QWidget] = None,
|
||||
title: str = "default",
|
||||
*,
|
||||
mac_default_shortcuts: bool = True,
|
||||
) -> None:
|
||||
QWebEngineView.__init__(self, parent=parent)
|
||||
self.set_title(title)
|
||||
|
@ -242,23 +240,6 @@ class AnkiWebView(QWebEngineView):
|
|||
context=Qt.WidgetWithChildrenShortcut,
|
||||
activated=self.onEsc,
|
||||
)
|
||||
if isMac and mac_default_shortcuts:
|
||||
for key, fn in [
|
||||
(QKeySequence.Copy, self.onCopy),
|
||||
(QKeySequence.Paste, self.onPaste),
|
||||
(QKeySequence.Cut, self.onCut),
|
||||
(QKeySequence.SelectAll, self.onSelectAll),
|
||||
]:
|
||||
QShortcut( # type: ignore
|
||||
key, self, context=Qt.WidgetWithChildrenShortcut, activated=fn
|
||||
)
|
||||
|
||||
QShortcut( # type: ignore
|
||||
QKeySequence("ctrl+shift+v"),
|
||||
self,
|
||||
context=Qt.WidgetWithChildrenShortcut,
|
||||
activated=self.onPaste,
|
||||
)
|
||||
|
||||
def set_title(self, title: str) -> None:
|
||||
self.title = title # type: ignore[assignment]
|
||||
|
|
Loading…
Reference in a new issue