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)

This commit is contained in:
Kovid Goyal 2022-08-11 20:28:46 +05:30
parent a8b1066276
commit e7d4ab0575
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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)