From 8bd5c9b50fb0fa5c4ad0095c01d775475dbf992a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 5 Jun 2018 14:32:09 +0530 Subject: [PATCH] Edit Book: Preview panel: Show previews when editing SVG files --- src/calibre/gui2/tweak_book/boss.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index 2ab6c9c8db..d30cdc8038 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -1516,7 +1516,8 @@ class Boss(QObject): actions['go-to-line-number'].setEnabled(ed.has_line_numbers) actions['fix-html-current'].setEnabled(ed.syntax == 'html') 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): # The file being displayed by the preview has changed. # Set the preview's position to the current cursor