From e7d4ab05751a960d9525d0760fb49db3f2744bb1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 11 Aug 2022 20:28:46 +0530 Subject: [PATCH] Image popup: Allow zooming using the Ctrl+plus and Ctrl+minus standard shortcuts. Fixes #1985021 [[Enhancement - Image viewer] Clicking the + and - keys to zoom](https://bugs.launchpad.net/calibre/+bug/1985021) --- src/calibre/gui2/image_popup.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/calibre/gui2/image_popup.py b/src/calibre/gui2/image_popup.py index 91900cd309..bc3453b4f0 100644 --- a/src/calibre/gui2/image_popup.py +++ b/src/calibre/gui2/image_popup.py @@ -124,6 +124,14 @@ class ImageView(QDialog): self.current_url = current_url self.factor = 1.0 self.geom_name = geom_name + self.zoom_in_action = ac = QAction(self) + ac.triggered.connect(self.zoom_in) + ac.setShortcut(QKeySequence(QKeySequence.StandardKey.ZoomIn)) + self.addAction(ac) + self.zoom_out_action = ac = QAction(self) + ac.triggered.connect(self.zoom_out) + ac.setShortcut(QKeySequence(QKeySequence.StandardKey.ZoomOut)) + self.addAction(ac) self.scrollarea = sa = ScrollArea() sa.setAlignment(Qt.AlignmentFlag.AlignHCenter | Qt.AlignmentFlag.AlignVCenter)