mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit Book: Fix high-dpi rendering of emblems in the File Browser
This commit is contained in:
parent
95f62fcad2
commit
d23532e499
@ -344,10 +344,11 @@ class FileList(QTreeWidget):
|
||||
icon = self.rendered_emblem_cache[emblems] = QIcon(pixmaps[0])
|
||||
else:
|
||||
canvas = QPixmap((num * w) + ((num-1)*2), h)
|
||||
canvas.setDevicePixelRatio(pixmaps[0].devicePixelRatio())
|
||||
canvas.fill(Qt.transparent)
|
||||
painter = QPainter(canvas)
|
||||
for i, pm in enumerate(pixmaps):
|
||||
painter.drawPixmap(i * (w + 2), 0, pm)
|
||||
painter.drawPixmap(int(i * (w + 2)/canvas.devicePixelRatio()), 0, pm)
|
||||
painter.end()
|
||||
icon = self.rendered_emblem_cache[emblems] = canvas
|
||||
item.setData(0, Qt.DecorationRole, icon)
|
||||
|
Loading…
x
Reference in New Issue
Block a user