Qt: smoother compat circles in list mode
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user