mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
Add drag/drop support when adding IO images (#3776)
* allow adding images via drag/drop when adding io * support editing io notes as well Co-authored-by: Abdo <abdo@abdnh.net> --------- Co-authored-by: Abdo <abdo@abdnh.net>
This commit is contained in:
parent
00501c267c
commit
56dd93b5be
1 changed files with 9 additions and 0 deletions
|
@ -1553,6 +1553,15 @@ class EditorWebView(AnkiWebView):
|
||||||
extended = self._wantsExtendedPaste()
|
extended = self._wantsExtendedPaste()
|
||||||
mime = evt.mimeData()
|
mime = evt.mimeData()
|
||||||
assert mime is not None
|
assert mime is not None
|
||||||
|
|
||||||
|
if (
|
||||||
|
self.editor.state is EditorState.IO_PICKER
|
||||||
|
and (html := self._processUrls(mime, allowed_suffixes=pics))
|
||||||
|
and (path := self.editor.extract_img_path_from_html(html))
|
||||||
|
):
|
||||||
|
self.editor.setup_mask_editor(path)
|
||||||
|
return
|
||||||
|
|
||||||
evt_pos = evt.position()
|
evt_pos = evt.position()
|
||||||
cursor_pos = QPoint(int(evt_pos.x()), int(evt_pos.y()))
|
cursor_pos = QPoint(int(evt_pos.x()), int(evt_pos.y()))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue