mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Allow copying of images using context menu
This commit is contained in:
parent
fee9b199d5
commit
d5b3927d0b
1 changed files with 6 additions and 1 deletions
|
@ -266,7 +266,12 @@ class AnkiWebView(QWebEngineView):
|
|||
w = w.parent()
|
||||
|
||||
def onCopy(self):
|
||||
self.triggerPageAction(QWebEnginePage.Copy)
|
||||
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):
|
||||
self.triggerPageAction(QWebEnginePage.Cut)
|
||||
|
|
Loading…
Reference in a new issue