From 402fc88b73b3a128a63ae5b88d0c8bcdb6e6e1df Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 25 Aug 2016 20:56:28 +0530 Subject: [PATCH] ... --- src/calibre/gui2/icon_theme.py | 3 ++- src/calibre/gui2/preferences/look_feel.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/icon_theme.py b/src/calibre/gui2/icon_theme.py index aa7924bd89..1f40c93e14 100644 --- a/src/calibre/gui2/icon_theme.py +++ b/src/calibre/gui2/icon_theme.py @@ -497,7 +497,7 @@ class Delegate(QStyledItemDelegate): pixmap = index.data(Qt.DecorationRole) if pixmap and not pixmap.isNull(): rect = option.rect.adjusted(0, self.SPACING, COVER_SIZE[0] - option.rect.width(), - self.SPACING) - painter.drawPixmap(rect, pixmap, pixmap.rect()) + painter.drawPixmap(rect, pixmap) if option.state & QStyle.State_Selected: painter.setPen(QPen(QApplication.instance().palette().highlightedText().color())) bottom = option.rect.bottom() - 2 @@ -690,6 +690,7 @@ class ChooseTheme(Dialog): theme['cover-pixmap'] = p = QPixmap() if isinstance(cdata, bytes): p.loadFromData(cdata) + p.setDevicePixelRatio(self.devicePixelRatio()) item = self.item_from_name(theme['name']) if item is not None: item.setData(Qt.DecorationRole, p) diff --git a/src/calibre/gui2/preferences/look_feel.py b/src/calibre/gui2/preferences/look_feel.py index 378b5993b2..b95b02c57e 100644 --- a/src/calibre/gui2/preferences/look_feel.py +++ b/src/calibre/gui2/preferences/look_feel.py @@ -239,7 +239,9 @@ class Background(QWidget): # {{{ from calibre.gui2.preferences.texture_chooser import texture_path path = texture_path(self.btex) if path: - self.brush.setTexture(QPixmap(path)) + p = QPixmap(path) + p.setDevicePixelRatio(self.devicePixelRatio()) + self.brush.setTexture(p) self.update() def sizeHint(self):