E-book viewer: Image popup: Show the image resolution in the popup window's titlebar

This commit is contained in:
Kovid Goyal 2021-06-04 21:02:20 +05:30
parent 71273ba7f7
commit 955f807708
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -251,7 +251,10 @@ class ImageView(QDialog):
self.current_image_name = unicode_type(self.current_url.toString(NO_URL_FORMATTING)).rpartition('/')[-1] self.current_image_name = unicode_type(self.current_url.toString(NO_URL_FORMATTING)).rpartition('/')[-1]
except AttributeError: except AttributeError:
self.current_image_name = self.current_url 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) self.setWindowTitle(title)
if use_exec: if use_exec:
self.exec_() self.exec_()