mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 00:41:26 +12:00
Qt: smoother compat circles in list mode
This commit is contained in:
parent
f480ba13c0
commit
ea0f04e130
2 changed files with 5 additions and 4 deletions
|
@ -76,13 +76,14 @@ Q_SIGNALS:
|
||||||
class compat_pixmap : public QPixmap
|
class compat_pixmap : public QPixmap
|
||||||
{
|
{
|
||||||
public:
|
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);
|
fill(Qt::transparent);
|
||||||
|
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
|
setDevicePixelRatio(pixel_ratio);
|
||||||
painter.setPen(color);
|
painter.setPen(color);
|
||||||
painter.setBrush(color);
|
painter.setBrush(color);
|
||||||
painter.drawEllipse(0, 0, 15, 15);
|
painter.drawEllipse(0, 0, 15 * pixel_ratio, 15 * pixel_ratio);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "game_list_frame.h"
|
#include "game_list_frame.h"
|
||||||
#include "qt_utils.h"
|
#include "qt_utils.h"
|
||||||
#include "settings_dialog.h"
|
#include "settings_dialog.h"
|
||||||
#include "table_item_delegate.h"
|
#include "table_item_delegate.h"
|
||||||
|
@ -1581,7 +1581,7 @@ int game_list_frame::PopulateGameList()
|
||||||
compat_item->setToolTip(game->compat.tooltip);
|
compat_item->setToolTip(game->compat.tooltip);
|
||||||
if (!game->compat.color.isEmpty())
|
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
|
// Version
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue