diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-04-29 20:23:00 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-04-29 20:23:00 +0200 |
commit | 27350cf51e3ea9a29e475f0bbb7a245220447c68 (patch) | |
tree | 60a25df221fa58c197ddd01441128a5397cf0c45 /src/RoomInfoListItem.cpp | |
parent | Send correct orientation for exif rotated images (diff) | |
download | nheko-27350cf51e3ea9a29e475f0bbb7a245220447c68.tar.xz |
Fix high CPU usage on high dpi screens
Fixes #180
Diffstat (limited to 'src/RoomInfoListItem.cpp')
-rw-r--r-- | src/RoomInfoListItem.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/RoomInfoListItem.cpp b/src/RoomInfoListItem.cpp index 11818649..13c7b54d 100644 --- a/src/RoomInfoListItem.cpp +++ b/src/RoomInfoListItem.cpp @@ -151,7 +151,8 @@ RoomInfoListItem::paintEvent(QPaintEvent *event) auto wm = getMetrics(QFont{}); - QPixmap pixmap(avatar_->size()); + QPixmap pixmap(avatar_->size() * p.device()->devicePixelRatioF()); + pixmap.setDevicePixelRatio(p.device()->devicePixelRatioF()); if (isPressed_) { p.fillRect(rect(), highlightedBackgroundColor_); titlePen.setColor(highlightedTitleColor_); |