mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-04 06:03:06 +02:00
Fix rendering of cover in book details popup window on high DPI screens
This commit is contained in:
parent
1e90aaa1a8
commit
0b4ff115a8
1 changed files with 4 additions and 1 deletions
|
|
@ -166,8 +166,10 @@ def resize_cover(self):
|
|||
pixmap.height(), self.cover.size().width()-10,
|
||||
self.cover.size().height()-10)
|
||||
if scaled:
|
||||
pixmap = pixmap.scaled(new_width, new_height,
|
||||
dpr = self.devicePixelRatio()
|
||||
pixmap = pixmap.scaled(int(dpr * new_width), int(dpr * new_height),
|
||||
Qt.KeepAspectRatio, Qt.SmoothTransformation)
|
||||
pixmap.setDevicePixelRatio(dpr)
|
||||
self.cover.set_pixmap(pixmap)
|
||||
self.update_cover_tooltip()
|
||||
|
||||
|
|
@ -198,6 +200,7 @@ def refresh(self, row, mi=None):
|
|||
self.current_row = row
|
||||
self.setWindowTitle(mi.title)
|
||||
self.cover_pixmap = QPixmap.fromImage(mi.cover_data[1])
|
||||
self.cover_pixmap.setDevicePixelRatio(self.devicePixelRatio())
|
||||
self.resize_cover()
|
||||
html = render_html(mi, self.css, True, self, all_fields=True)
|
||||
self.details.setHtml(html)
|
||||
|
|
|
|||
Loading…
Reference in a new issue