mirror of
https://github.com/ankitects/anki.git
synced 2025-11-13 08:07:11 -05:00
text over images, pass current widget when adding picture
This commit is contained in:
parent
71dbc8bcd2
commit
0bbc7c7c74
1 changed files with 4 additions and 4 deletions
|
|
@ -569,13 +569,13 @@ class FactEdit(QTextEdit):
|
|||
self.parent = parent
|
||||
|
||||
def insertFromMimeData(self, source):
|
||||
if source.hasImage():
|
||||
if source.hasText():
|
||||
self.insertPlainText(source.text())
|
||||
elif source.hasImage():
|
||||
im = QImage(source.imageData())
|
||||
(fd, name) = tempfile.mkstemp(suffix=".jpg")
|
||||
im.save(name, None, 95)
|
||||
self.parent._addPicture(name)
|
||||
elif source.hasText():
|
||||
self.insertPlainText(source.text())
|
||||
self.parent._addPicture(name, widget=self)
|
||||
elif source.hasHtml():
|
||||
self.insertHtml(self.simplifyHTML(unicode(source.html())))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue