From cf1073a2e7ea1385ad97f50351c682c88a1a97d3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Apr 2026 00:52:29 +0000 Subject: [PATCH] Add reset zoom to 100% to preview pane right-click menu Agent-Logs-Url: https://github.com/kovidgoyal/calibre/sessions/ce72136c-a4a4-4bc6-b03f-711888d9d266 Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com> --- src/calibre/gui2/tweak_book/preview.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/calibre/gui2/tweak_book/preview.py b/src/calibre/gui2/tweak_book/preview.py index 7674af9226..f11b4d29ca 100644 --- a/src/calibre/gui2/tweak_book/preview.py +++ b/src/calibre/gui2/tweak_book/preview.py @@ -467,6 +467,9 @@ class WebView(QWebEngineView, OpenWithHandler): aspects of your e-book will not work, such as page breaks and page margins. ''')) + def reset_zoom(self): + self.setZoomFactor(1.0) + def inspect(self): self.inspector.parent().show() self.inspector.parent().raise_and_focus() @@ -483,6 +486,8 @@ class WebView(QWebEngineView, OpenWithHandler): if ca.isEnabled(): menu.addAction(ca) menu.addAction(actions['reload-preview']) + if self.zoomFactor() != 1.0: + menu.addAction(_('Reset zoom to 100%'), self.reset_zoom) menu.addAction(QIcon.ic('debug.png'), _('Inspect element'), self.inspect) if url.partition(':')[0].lower() in {'http', 'https'}: menu.addAction(_('Open link'), partial(safe_open_url, data.linkUrl()))