Also popup cover on double click in edit metadata dialog

This commit is contained in:
Kovid Goyal 2024-12-20 19:47:32 +05:30
parent bdb77a370f
commit 6a42e1bef9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1234,6 +1234,13 @@ class Cover(ImageView): # {{{
m.addAction(QIcon.ic('view-image'), _('View image in popup window'), self.view_image) m.addAction(QIcon.ic('view-image'), _('View image in popup window'), self.view_image)
return m return m
def mouseDoubleClickEvent(self, event):
if event.button() == Qt.MouseButton.LeftButton:
event.accept()
self.view_image()
else:
super().mouseDoubleClickEvent(event)
def view_image(self): def view_image(self):
from calibre.gui2.image_popup import ImageView from calibre.gui2.image_popup import ImageView
d = ImageView(self, self.pixmap(), 'cover.jpg') d = ImageView(self, self.pixmap(), 'cover.jpg')