mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Fix rendering of cover in book details popup window on high DPI screens
This commit is contained in:
parent
1e90aaa1a8
commit
0b4ff115a8
@ -166,8 +166,10 @@ class BookInfo(QDialog):
|
|||||||
pixmap.height(), self.cover.size().width()-10,
|
pixmap.height(), self.cover.size().width()-10,
|
||||||
self.cover.size().height()-10)
|
self.cover.size().height()-10)
|
||||||
if scaled:
|
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)
|
Qt.KeepAspectRatio, Qt.SmoothTransformation)
|
||||||
|
pixmap.setDevicePixelRatio(dpr)
|
||||||
self.cover.set_pixmap(pixmap)
|
self.cover.set_pixmap(pixmap)
|
||||||
self.update_cover_tooltip()
|
self.update_cover_tooltip()
|
||||||
|
|
||||||
@ -198,6 +200,7 @@ class BookInfo(QDialog):
|
|||||||
self.current_row = row
|
self.current_row = row
|
||||||
self.setWindowTitle(mi.title)
|
self.setWindowTitle(mi.title)
|
||||||
self.cover_pixmap = QPixmap.fromImage(mi.cover_data[1])
|
self.cover_pixmap = QPixmap.fromImage(mi.cover_data[1])
|
||||||
|
self.cover_pixmap.setDevicePixelRatio(self.devicePixelRatio())
|
||||||
self.resize_cover()
|
self.resize_cover()
|
||||||
html = render_html(mi, self.css, True, self, all_fields=True)
|
html = render_html(mi, self.css, True, self, all_fields=True)
|
||||||
self.details.setHtml(html)
|
self.details.setHtml(html)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user