From 955f80770880ea56a106fe4af47f0d362fc540d4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 4 Jun 2021 21:02:20 +0530 Subject: [PATCH] E-book viewer: Image popup: Show the image resolution in the popup window's titlebar --- src/calibre/gui2/image_popup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/image_popup.py b/src/calibre/gui2/image_popup.py index 2723faa949..1c17770ebd 100644 --- a/src/calibre/gui2/image_popup.py +++ b/src/calibre/gui2/image_popup.py @@ -251,7 +251,10 @@ class ImageView(QDialog): self.current_image_name = unicode_type(self.current_url.toString(NO_URL_FORMATTING)).rpartition('/')[-1] except AttributeError: self.current_image_name = self.current_url - title = _('View image: %s')%self.current_image_name + reso = '' + if self.current_img and not self.current_img.isNull(): + reso = f'[{self.current_img.width()}x{self.current_img.height()}]' + title = _('Image: {name} {resolution}').format(name=self.current_image_name, resolution=reso) self.setWindowTitle(title) if use_exec: self.exec_()