mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Merge pull request #767 from abdnh/context-menu-copy-image
Allow copying of images using context menu
This commit is contained in:
commit
c6ea97b69c
1 changed files with 6 additions and 1 deletions
|
@ -266,6 +266,11 @@ class AnkiWebView(QWebEngineView):
|
|||
w = w.parent()
|
||||
|
||||
def onCopy(self):
|
||||
if not self.selectedText():
|
||||
ctx = self._page.contextMenuData()
|
||||
if ctx and ctx.mediaType() == QWebEngineContextMenuData.MediaTypeImage:
|
||||
self.triggerPageAction(QWebEnginePage.CopyImageToClipboard)
|
||||
else:
|
||||
self.triggerPageAction(QWebEnginePage.Copy)
|
||||
|
||||
def onCut(self):
|
||||
|
|
Loading…
Reference in a new issue