From ea0f04e130c2a6ef08f2e4b7997b6c9bd50d236f Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sat, 4 May 2019 18:13:49 +0200 Subject: [PATCH] Qt: smoother compat circles in list mode --- rpcs3/rpcs3qt/game_compatibility.h | 5 +++-- rpcs3/rpcs3qt/game_list_frame.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/rpcs3/rpcs3qt/game_compatibility.h b/rpcs3/rpcs3qt/game_compatibility.h index f9074fe00a..08c0263d2a 100644 --- a/rpcs3/rpcs3qt/game_compatibility.h +++ b/rpcs3/rpcs3qt/game_compatibility.h @@ -76,13 +76,14 @@ Q_SIGNALS: class compat_pixmap : public QPixmap { public: - compat_pixmap(const QColor& color) : QPixmap(16, 16) + compat_pixmap(const QColor& color, int pixel_ratio) : QPixmap(16 * pixel_ratio, 16 * pixel_ratio) { fill(Qt::transparent); QPainter painter(this); + setDevicePixelRatio(pixel_ratio); painter.setPen(color); painter.setBrush(color); - painter.drawEllipse(0, 0, 15, 15); + painter.drawEllipse(0, 0, 15 * pixel_ratio, 15 * pixel_ratio); } }; diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 86b83b3955..40d3598f90 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -1,4 +1,4 @@ -#include "game_list_frame.h" +#include "game_list_frame.h" #include "qt_utils.h" #include "settings_dialog.h" #include "table_item_delegate.h" @@ -1581,7 +1581,7 @@ int game_list_frame::PopulateGameList() compat_item->setToolTip(game->compat.tooltip); if (!game->compat.color.isEmpty()) { - compat_item->setData(Qt::DecorationRole, compat_pixmap(game->compat.color)); + compat_item->setData(Qt::DecorationRole, compat_pixmap(game->compat.color, devicePixelRatio() * 2)); } // Version