Edit Book: Preview panel: Show previews when editing SVG files

This commit is contained in:
Kovid Goyal 2018-06-05 14:32:09 +05:30
parent e42e31cdcb
commit 8bd5c9b50f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1516,7 +1516,8 @@ class Boss(QObject):
actions['go-to-line-number'].setEnabled(ed.has_line_numbers) actions['go-to-line-number'].setEnabled(ed.has_line_numbers)
actions['fix-html-current'].setEnabled(ed.syntax == 'html') actions['fix-html-current'].setEnabled(ed.syntax == 'html')
name = editor_name(ed) name = editor_name(ed)
if name is not None and getattr(ed, 'syntax', None) == 'html': mime = current_container().mime_map.get(name)
if name is not None and (getattr(ed, 'syntax', None) == 'html' or mime == 'image/svg+xml'):
if self.gui.preview.show(name): if self.gui.preview.show(name):
# The file being displayed by the preview has changed. # The file being displayed by the preview has changed.
# Set the preview's position to the current cursor # Set the preview's position to the current cursor