mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Hide right click copy option in deck list (#3363)
* hide copy if nothing selected * Update CONTRIBUTORS * type hint * Update CONTRIBUTORS
This commit is contained in:
parent
c99b50c82f
commit
f2adf5d9ad
1 changed files with 6 additions and 2 deletions
|
@ -379,11 +379,15 @@ class AnkiWebView(QWebEngineView):
|
|||
|
||||
def contextMenuEvent(self, evt: QContextMenuEvent) -> None:
|
||||
m = QMenu(self)
|
||||
a = m.addAction(tr.actions_copy())
|
||||
qconnect(a.triggered, self.onCopy)
|
||||
self._maybe_add_copy_action(m)
|
||||
gui_hooks.webview_will_show_context_menu(self, m)
|
||||
m.popup(QCursor.pos())
|
||||
|
||||
def _maybe_add_copy_action(self, menu: QMenu) -> None:
|
||||
if self.hasSelection():
|
||||
a = menu.addAction(tr.actions_copy())
|
||||
qconnect(a.triggered, self.onCopy)
|
||||
|
||||
def dropEvent(self, evt: QDropEvent) -> None:
|
||||
if self.allow_drops:
|
||||
super().dropEvent(evt)
|
||||
|
|
Loading…
Reference in a new issue